Commit ec9f8e09 authored by Dries's avatar Dries

- Patch #216904 by pwolanin et al: if there are more than 21 menu items under...

- Patch #216904 by pwolanin et al: if there are more than 21 menu items under a parent, the weights got screwy.
parent 88eda488
......@@ -690,9 +690,16 @@ Drupal.tableDrag.prototype.updateField = function(changedRow, group) {
$('option', targetElement).each(function() {
values.push(this.value);
});
var maxVal = values[values.length - 1];
// Populate the values in the siblings.
$(targetClass, siblings).each(function() {
this.value = values.shift();
// If there are more items than possible values, assign the maximum value to the row.
if (values.length > 0) {
this.value = values.shift();
}
else {
this.value = maxVal;
}
});
}
else {
......
......@@ -80,6 +80,7 @@ function _menu_overview_tree_form($tree) {
);
$form[$mlid]['weight'] = array(
'#type' => 'weight',
'#delta' => 50,
'#default_value' => isset($form_state[$mlid]['weight']) ? $form_state[$mlid]['weight'] : $item['weight'],
);
$form[$mlid]['mlid'] = array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment