From f0c46ad6f8abe28fbf45db47c1be42a9cfcfa661 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 17 Jan 2014 18:00:36 +0000 Subject: [PATCH] Some UI improvements - call delete async, server can notify of failure - Immediately delete row for fast feedback - leave preview open, nextmatch will select next row --- mail/js/app.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 488ffa6eb4..93803df6ca 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -928,9 +928,17 @@ app.classes.mail = AppJS.extend( */ mail_deleteMessages: function(_msg,_action,_calledFromPopup) { - egw_message(this.egw.lang('delete messages')); + // Tell server egw.json('mail.mail_ui.ajax_deleteMessages',[_msg,(typeof _action == 'undefined'?'no':_action)]) - .sendRequest(); + .sendRequest(true); + + // Update list + var ids = []; + for (var i = 0; i < _msg['msg'].length; i++) + { + ids.push(_msg['msg'][i].replace(/mail::/,'')); + } + egw_refresh(this.egw.lang('delete messages'),'mail',ids,'delete'); }, /** @@ -940,15 +948,7 @@ app.classes.mail = AppJS.extend( */ mail_deleteMessagesShowResult: function(_msg) { - var myMessage = _msg['egw_message']; - for (var i = 0; i < _msg['msg'].length; i++) - { - egw_refresh(myMessage,'mail',_msg['msg'][i].replace(/mail::/,''),'delete'); - egw.dataDeleteUID(_msg['msg'][i]); - } - //this.mail_refreshMessageGrid(_calledFromPopup); - - this.mail_preview(); + egw_message(_msg['egw_message']); }, /**