diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-05-26 07:28:42 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-05-26 07:28:42 +0000 |
| commit | a2131b67894cb4cba2e43df99ae20514b95b11d4 (patch) | |
| tree | cb4cf4f7e7ad6a74d8593d996530ec9cd5ba3e37 /roundcubemail/program | |
| parent | 7cda354a02556dcbd8aa8927161dd6cb3a3e6b83 (diff) | |
- Add drag cancelling with ESC key (#1484344)
git-svn-id: https://svn.roundcube.net/trunk@2538 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/js/app.js | 19 | ||||
| -rw-r--r-- | roundcubemail/program/js/list.js | 4 |
2 files changed, 21 insertions, 2 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index 8b357e70a..b29a3575d 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/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) { diff --git a/roundcubemail/program/js/list.js b/roundcubemail/program/js/list.js index 17bf4cf3f..addd1e652 100644 --- a/roundcubemail/program/js/list.js +++ b/roundcubemail/program/js/list.js @@ -625,6 +625,7 @@ key_press: function(e) var keyCode = rcube_event.get_keycode(e); var mod_key = rcube_event.get_modifier(e); + switch (keyCode) { case 40: @@ -653,6 +654,9 @@ key_down: function(e) { switch (rcube_event.get_keycode(e)) { + case 27: + if (this.drag_active) + this.drag_mouse_up(e); case 40: case 38: case 63233: |
