diff --git a/core/includes/common.inc b/core/includes/common.inc index 409fa67..9f30db9 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -1944,7 +1944,7 @@ function drupal_attach_tabledrag(&$element, array $options) { 'subgroup' => NULL, 'source' => NULL, 'hidden' => TRUE, - 'limit' => 0 + 'limit' => -1 ); $group = $options['group']; diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index 1e61eff..7fc8d64 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -58,7 +58,7 @@ this.oldRowElement = null; // Remember the previous element. this.oldY = 0; // Used to determine up or down direction from last mouse move. this.changed = false; // Whether anything in the entire table has changed. - this.maxDepth = 0; // Maximum amount of allowed parenting. + this.maxDepth = -1; // Maximum amount of allowed parenting. this.rtl = $(this.table).css('direction') === 'rtl' ? -1 : 1; // Direction of the table. // Configure the scroll settings. @@ -78,7 +78,7 @@ if (tableSettings[group][n].relationship === 'parent') { this.indentEnabled = true; } - if (tableSettings[group][n].limit > 0) { + if (tableSettings[group][n].limit > -1) { this.maxDepth = tableSettings[group][n].limit; } } @@ -1121,7 +1121,7 @@ // Do not go deeper than as a child of the previous row. maxIndent = $prevRow.find('.indentation').length + ($prevRow.is('.tabledrag-leaf') ? 0 : 1); // Limit by the maximum allowed depth for the table. - if (this.maxDepth) { + if (this.maxDepth > -1) { maxIndent = Math.min(maxIndent, this.maxDepth - (this.groupDepth - this.indents)); } }