summaryrefslogtreecommitdiff
path: root/misc/tabledrag.js
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-11-27 13:10:24 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-11-27 13:10:24 +0000
commit1f299b52e0571d01cd9b15ae53ec60ca099c18fa (patch)
tree2df9a485ccb3312cc5ec164bb76d15a58b6e3732 /misc/tabledrag.js
parentb0a4ad29da58b1904cc271f794eb72e72215e4c0 (diff)
downloadbrdo-1f299b52e0571d01cd9b15ae53ec60ca099c18fa.tar.gz
brdo-1f299b52e0571d01cd9b15ae53ec60ca099c18fa.tar.bz2
#195073 by yched and quicksketch: allow multiple drag and drop utilizing tables to be used on the same page (small bug fix)
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r--misc/tabledrag.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/misc/tabledrag.js b/misc/tabledrag.js
index 797113332..e1a56f974 100644
--- a/misc/tabledrag.js
+++ b/misc/tabledrag.js
@@ -87,8 +87,8 @@ Drupal.tableDrag = function(table, tableSettings) {
// Add mouse bindings to the document. The self variable is passed along
// as event handlers do not have direct access to the tableDrag object.
- $(document).bind('mousemove', { tableDrag: self }, self.dragRow);
- $(document).bind('mouseup', { tableDrag: self }, self.dropRow);
+ $(document).bind('mousemove', function(event) { self.dragRow(event, self); });
+ $(document).bind('mouseup', function(event) { self.dropRow(event, self); });
};
/**
@@ -240,7 +240,7 @@ Drupal.tableDrag.prototype.makeDraggable = function(item) {
$(this).removeClass('tabledrag-handle-hover');
if (self.rowObject && self.safeBlur) {
event.data = { tableDrag: self };
- self.dropRow(event);
+ self.dropRow(event, self);
}
});
@@ -341,9 +341,7 @@ Drupal.tableDrag.prototype.makeDraggable = function(item) {
/**
* Mousemove event handler, bound to document.
*/
-Drupal.tableDrag.prototype.dragRow = function(event) {
- var self = event.data.tableDrag;
-
+Drupal.tableDrag.prototype.dragRow = function(event, self) {
if (self.dragObject) {
self.currentMouseCoords = self.mouseCoords(event);
@@ -405,9 +403,7 @@ Drupal.tableDrag.prototype.dragRow = function(event) {
* Mouseup event handler, bound to document.
* Blur event handler, bound to drag handle for keyboard support.
*/
-Drupal.tableDrag.prototype.dropRow = function(event) {
- var self = event.data.tableDrag;
-
+Drupal.tableDrag.prototype.dropRow = function(event, self) {
// Drop row functionality shared between mouseup and blur events.
if (self.rowObject != null) {
var droppedRow = self.rowObject.element;