summaryrefslogtreecommitdiff
path: root/misc/tabledrag.js
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r--misc/tabledrag.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/misc/tabledrag.js b/misc/tabledrag.js
index db40f2437..0c7acbc75 100644
--- a/misc/tabledrag.js
+++ b/misc/tabledrag.js
@@ -15,17 +15,11 @@
Drupal.behaviors.tableDrag = {
attach: function (context, settings) {
for (var base in settings.tableDrag) {
- if (!$('#' + base + '.tabledrag-processed', context).size()) {
- var tableSettings = settings.tableDrag[base];
-
- $('#' + base).filter(':not(.tabledrag-processed)').each(function () {
- // Create the new tableDrag instance. Save in the Drupal variable
- // to allow other scripts access to the object.
- Drupal.tableDrag[base] = new Drupal.tableDrag(this, tableSettings);
- });
-
- $('#' + base).addClass('tabledrag-processed');
- }
+ $('#' + base, context).once('tabledrag', function () {
+ // Create the new tableDrag instance. Save in the Drupal variable
+ // to allow other scripts access to the object.
+ Drupal.tableDrag[base] = new Drupal.tableDrag(this, settings.tableDrag[base]);
+ });
}
}
};