From: Michael M Slusarz Date: Fri, 26 Mar 2010 06:49:57 +0000 (-0600) Subject: Add DragDrop2:mouseup action X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=43a52a42a55da2973c84bc73064773e1845a3fe8;p=horde.git Add DragDrop2:mouseup action --- diff --git a/horde/js/dragdrop2.js b/horde/js/dragdrop2.js index c2c6ad6cb..7653ff365 100644 --- a/horde/js/dragdrop2.js +++ b/horde/js/dragdrop2.js @@ -46,11 +46,14 @@ * Fired on mousemove. * * 'DragDrop2:end' - * Fired on mouseup. + * Fired when dragging ends. * * 'DragDrop2:mousedown' * Fired on mousedown. * + * 'DragDrop2:mouseup' + * Fored on mouseup *if* the element was not dragged. + * * 'DragDrop2:start' * Fired when first moved more than 'threshold'. * @@ -446,9 +449,7 @@ Drag = Class.create({ DragDrop.Drags.cover.down().siblings().invoke('remove'); } - if (this.wasMoved) { - this.element.fire('DragDrop2:end', e); - } + this.element.fire(this.wasMoved ? 'DragDrop2:end' : 'DragDrop2:mouseup', e); }, _onMoveDrag: function(xy, e)