From ec9f8e090a3572511b7f42490c70d7f3d5d590c8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 10 Feb 2008 19:14:08 +0000 Subject: - Patch #216904 by pwolanin et al: if there are more than 21 menu items under a parent, the weights got screwy. --- misc/tabledrag.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'misc') diff --git a/misc/tabledrag.js b/misc/tabledrag.js index edcb5def5..609681104 100644 --- a/misc/tabledrag.js +++ b/misc/tabledrag.js @@ -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 { -- cgit v1.2.3