diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-10-29 10:01:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-10-29 10:01:28 +0000 |
commit | 5371104a2d10889c532bb5d345fa6d71c0a897d1 (patch) | |
tree | bbef382cea55823195e0cb7469074b743913bc74 /misc/tabledrag.js | |
parent | 068febde425f4521d61f863ffaca76da65916449 (diff) | |
download | brdo-5371104a2d10889c532bb5d345fa6d71c0a897d1.tar.gz brdo-5371104a2d10889c532bb5d345fa6d71c0a897d1.tar.bz2 |
- Patch #316225 by sun et al: allow behaviors to detach from AHAH/AJAX.
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r-- | misc/tabledrag.js | 24 |
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'); + } } } }; |