diff --git a/misc/tabledrag.js b/misc/tabledrag.js index 3cc2701..416fa67 100644 --- a/misc/tabledrag.js +++ b/misc/tabledrag.js @@ -108,6 +108,8 @@ Drupal.tableDrag = function (table, tableSettings) { // as event handlers do not have direct access to the tableDrag object. $(document).bind('mousemove', function (event) { return self.dragRow(event, self); }); $(document).bind('mouseup', function (event) { return self.dropRow(event, self); }); + $(document).bind('touchmove', function (event) { return self.dragRow(event.originalEvent.touches[0], self); }); + $(document).bind('touchend', function (event) { return self.dropRow(event.originalEvent.touches[0], self); }); }; /** @@ -274,7 +276,8 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { }); // Add the mousedown action for the handle. - handle.mousedown(function (event) { + handle.on('mousedown touchstart', function (event) { + if(event.originalEvent.type != "mousedown") event=event.originalEvent.touches[0]; // Create a new dragObject recording the event information. self.dragObject = {}; self.dragObject.initMouseOffset = self.getMouseOffset(item, event);