From a14e52753be06248d3b48fda704f9e63e92c8415 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 7 Jan 2016 11:31:17 +0000 Subject: [PATCH] Prompt user for mail folder d-n-d action --- mail/js/app.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 7a6a0fd671..6730d6bbaa 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -3143,20 +3143,29 @@ app.classes.mail = AppJS.extend( return; } var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]'); - egw.message (egw.lang('Folder %1 is moving to folder %2',_senders[0].id, destination.id)); - egw.loading_prompt('mail_moveFolder', true,'','#egw_fw_basecontainer'); - for(var i = 0; i < _senders.length; i++) + + var callback = function (_button) { - egw.jsonq('mail.mail_ui.ajax_MoveFolder',[_senders[i].id, destination.id], - // Move is done (successfully or not), remove loading - function() { - var id = destination.id.split('::'); - //refersh the top parent - ftree.refreshItem(id[0],null); - egw.loading_prompt('mail_moveFolder', false); + if (_button == et2_dialog.YES_BUTTON) + { + egw.message (egw.lang('Folder %1 is moving to folder %2',_senders[0].id, destination.id)); + egw.loading_prompt('mail_moveFolder', true,'','#egw_fw_basecontainer'); + for(var i = 0; i < _senders.length; i++) + { + egw.jsonq('mail.mail_ui.ajax_MoveFolder',[_senders[i].id, destination.id], + // Move is done (successfully or not), remove loading + function() { + var id = destination.id.split('::'); + //refersh the top parent + ftree.refreshItem(id[0],null); + egw.loading_prompt('mail_moveFolder', false); + } + ); } - ); - } + } + }; + et2_dialog.show_dialog(callback, egw.lang('Are you sure you want to move folder %1 to folder %2?', + _senders[0].id, destination.id), 'Move folder', {},et2_dialog.BUTTONS_YES_NO, et2_dialog.WARNING_MESSAGE); }, /**