From c123de8513f9c5e3c783c6a5b7f1aacd6ca735d0 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sun, 4 Sep 2011 22:06:40 +0000 Subject: [PATCH] add dragangdroppause event --- source/Ox.UI/js/List/Ox.List.js | 59 ++++++++++++--------------------- 1 file changed, 22 insertions(+), 37 deletions(-) diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index ed8c7e25..e925fff7 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -33,6 +33,7 @@ Ox.List List Element draganddropend Fires on drop draganddropenter Fires when entering an item during drag draganddropleave Fires when leaving an item during drag + draganddroppause Fires when the mouse stops during drag draganddropstart Fires when drag starts copy copy paste paste @@ -82,6 +83,7 @@ Ox.List = function(options, self) { that.$content.bindEvent({ dragstart: dragstart, drag: drag, + dragpause: dragpause, dragenter: dragenter, dragleave: dragleave, dragend: dragend @@ -354,7 +356,7 @@ Ox.List = function(options, self) { ) { self.drag = { ids: self.options.selected - } + }; // fixme: shouldn't the target have been // automatically passed already, somewhere? that.triggerEvent('draganddropstart', { @@ -365,48 +367,31 @@ Ox.List = function(options, self) { } function drag(event, e) { - if (self.drag) { - that.triggerEvent('draganddrop', { - ids: self.drag.ids, - _event: e - }); - } + self.drag && that.triggerEvent('draganddrop', { + ids: self.drag.ids, + _event: e + }); + } + + function dragpause(event, e) { + self.drag && that.triggerEvent('draganddroppause', { + ids: self.drag.ids, + _event: e + }); } function dragenter(event, e) { - if (self.drag) { - that.triggerEvent('draganddropenter', { - ids: self.drag.ids, - _event: e - }); - } + self.drag && that.triggerEvent('draganddropenter', { + ids: self.drag.ids, + _event: e + }); } function dragleave(event, e) { - if (self.drag) { - that.triggerEvent('draganddropleave', { - ids: self.drag.ids, - _event: e - }); - } - } - - function dragenter(event, e) { - if (self.drag) { - that.triggerEvent('draganddropenter', { - ids: self.drag.ids, - _event: e - }); - } - } - - function dragleave(event, e) { - if (self.drag) { - that.triggerEvent('draganddropleave', { - ids: self.drag.ids, - _event: e - }); - } + self.drag && that.triggerEvent('draganddropleave', { + ids: self.drag.ids, + _event: e + }); } function dragend(event, e) {