Prompt user for mail folder d-n-d action

This commit is contained in:
Hadi Nategh 2016-01-07 11:31:17 +00:00
parent 748eb1ea2f
commit a14e52753b

View File

@ -3143,20 +3143,29 @@ app.classes.mail = AppJS.extend(
return; return;
} }
var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]'); 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'); var callback = function (_button)
for(var i = 0; i < _senders.length; i++)
{ {
egw.jsonq('mail.mail_ui.ajax_MoveFolder',[_senders[i].id, destination.id], if (_button == et2_dialog.YES_BUTTON)
// Move is done (successfully or not), remove loading {
function() { egw.message (egw.lang('Folder %1 is moving to folder %2',_senders[0].id, destination.id));
var id = destination.id.split('::'); egw.loading_prompt('mail_moveFolder', true,'','#egw_fw_basecontainer');
//refersh the top parent for(var i = 0; i < _senders.length; i++)
ftree.refreshItem(id[0],null); {
egw.loading_prompt('mail_moveFolder', false); 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);
}, },
/** /**