summaryrefslogtreecommitdiff
path: root/misc/tabledrag.js
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r--misc/tabledrag.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/tabledrag.js b/misc/tabledrag.js
index 4d4edfbd0..437b08c0f 100644
--- a/misc/tabledrag.js
+++ b/misc/tabledrag.js
@@ -125,7 +125,7 @@ Drupal.tableDrag.prototype.initColumns = function () {
var field = $('.' + this.tableSettings[group][d].target + ':first', this.table);
if (field.length && this.tableSettings[group][d].hidden) {
var hidden = this.tableSettings[group][d].hidden;
- var cell = field.parents('td:first');
+ var cell = field.closest('td');
break;
}
}
@@ -754,7 +754,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
switch (rowSettings.action) {
case 'depth':
// Get the depth of the target row.
- targetElement.value = $('.indentation', $(sourceElement).parents('tr:first')).length;
+ targetElement.value = $('.indentation', $(sourceElement).closest('tr')).length;
break;
case 'match':
// Update the value.
@@ -886,7 +886,7 @@ Drupal.tableDrag.prototype.row = function (tableRow, method, indentEnabled, maxD
this.group = [tableRow];
this.groupDepth = $('.indentation', tableRow).length;
this.changed = false;
- this.table = $(tableRow).parents('table:first').get(0);
+ this.table = $(tableRow).closest('table').get(0);
this.indentEnabled = indentEnabled;
this.maxDepth = maxDepth;
this.direction = ''; // Direction the row is being moved.