summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-01-29 13:05:47 +0100
committerThomas Bruederli <thomas@roundcube.net>2014-01-29 13:05:47 +0100
commit001e39e4eaabe5e28acaeec559a2e4ffe6f0ab92 (patch)
treec532e5757f8b16b04f78ad8b8900c650e5d99e97
parent1562a83608214dd23f4d7ab3b5e9b3c8a1693ce0 (diff)
Execute message/contact moving on dragend callback from list widget because that includes touch events (#1489431)
-rw-r--r--program/js/app.js50
1 files changed, 24 insertions, 26 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 5887eb6e6..540abf192 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1434,11 +1434,31 @@ function rcube_webmail()
this.drag_end = function(e)
{
- this.drag_active = false;
- this.env.last_folder_target = null;
+ var list, model;
if (this.treelist)
this.treelist.drag_end();
+
+ // execute drag & drop action when mouse was released
+ if (list = this.message_list)
+ model = this.env.mailboxes;
+ else if (list = this.contact_list)
+ model = this.env.contactfolders;
+
+ if (this.drag_active && model && this.env.last_folder_target) {
+ var target = model[this.env.last_folder_target];
+ list.draglayer.hide();
+
+ if (this.contact_list) {
+ if (!this.contacts_drag_menu(e, target))
+ this.command('move', target);
+ }
+ else if (!this.drag_menu(e, target))
+ this.command('move', target);
+ }
+
+ this.drag_active = false;
+ this.env.last_folder_target = null;
};
this.drag_move = function(e)
@@ -1499,38 +1519,16 @@ function rcube_webmail()
this.doc_mouse_up = function(e)
{
- var model, list, id;
+ var list, id;
// ignore event if jquery UI dialog is open
if ($(rcube_event.get_target(e)).closest('.ui-dialog, .ui-widget-overlay').length)
return;
- if (list = this.message_list)
- model = this.env.mailboxes;
- else if (list = this.contact_list)
- model = this.env.contactfolders;
- else if (this.ksearch_value)
- this.ksearch_blur();
-
+ list = this.message_list || this.contact_list;
if (list && !rcube_mouse_is_over(e, list.list.parentNode))
list.blur();
- // handle mouse release when dragging
- if (this.drag_active && model && this.env.last_folder_target) {
- var target = model[this.env.last_folder_target];
-
- this.env.last_folder_target = null;
- list.draglayer.hide();
- this.drag_end(e);
-
- if (this.contact_list) {
- if (!this.contacts_drag_menu(e, target))
- this.command('move', target);
- }
- else if (!this.drag_menu(e, target))
- this.command('move', target);
- }
-
// reset 'pressed' buttons
if (this.buttons_sel) {
for (id in this.buttons_sel)