diff options
author | alecpl <alec@alec.pl> | 2009-05-26 07:28:42 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-05-26 07:28:42 +0000 |
commit | 91d1a15ba89398cfb1a58f372b4a4329547b41a3 (patch) | |
tree | 9d697646d3927e411521379dd1f3e9f753e00d75 /program/js/app.js | |
parent | 1301e981103696df7745fc0015762e25aee854db (diff) |
- Add drag cancelling with ESC key (#1484344)
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/program/js/app.js b/program/js/app.js index 8b357e70a..b29a3575d 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -162,7 +162,7 @@ function rcube_webmail() this.message_list.addEventListener('select', function(o){ p.msglist_select(o); }); this.message_list.addEventListener('dragstart', function(o){ p.drag_start(o); }); this.message_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); }); - this.message_list.addEventListener('dragend', function(o){ p.drag_active = false; }); + this.message_list.addEventListener('dragend', function(o, e){ p.drag_end(e); }); document.onmouseup = function(e){ return p.doc_mouse_up(e); }; this.message_list.init(); @@ -278,7 +278,7 @@ function rcube_webmail() this.contact_list.addEventListener('select', function(o){ p.contactlist_select(o); }); this.contact_list.addEventListener('dragstart', function(o){ p.drag_start(o); }); this.contact_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); }); - this.contact_list.addEventListener('dragend', function(o){ p.drag_active = false; }); + this.contact_list.addEventListener('dragend', function(o, e){ p.drag_end(e); }); this.contact_list.init(); if (this.env.cid) @@ -1258,6 +1258,21 @@ function rcube_webmail() } }; + this.drag_end = function(e) + { + this.drag_active = false; + + // over the folders + if (this.gui_objects.folderlist && this.env.folder_coords) { + for (var k in this.env.folder_coords) { + if (k == this.env.last_folder_target) { + $(this.get_folder_li(k)).removeClass('droptarget'); + this.env.last_folder_target = null; + } + } + } + }; + this.drag_move = function(e) { if (this.gui_objects.folderlist && this.env.folder_coords) { |