summaryrefslogtreecommitdiff
path: root/misc/tabledrag.js
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r--misc/tabledrag.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/misc/tabledrag.js b/misc/tabledrag.js
index d8c1e6e9a..7d11cd39e 100644
--- a/misc/tabledrag.js
+++ b/misc/tabledrag.js
@@ -11,18 +11,20 @@
* overriding the .onDrag, .onDrop, .row.onSwap, and .row.onIndent methods.
* See blocks.js for an example of adding additional functionality to tableDrag.
*/
-Drupal.behaviors.tableDrag = function(context) {
- for (var base in Drupal.settings.tableDrag) {
- if (!$('#' + base + '.tabledrag-processed', context).size()) {
- var tableSettings = Drupal.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);
- });
+Drupal.behaviors.tableDrag = {
+ attach: function(context) {
+ for (var base in Drupal.settings.tableDrag) {
+ if (!$('#' + base + '.tabledrag-processed', context).size()) {
+ var tableSettings = Drupal.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).addClass('tabledrag-processed');
+ }
}
}
};