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
This commit is contained in:
Nathan Gray 2014-01-17 18:00:36 +00:00
parent 344a63b37c
commit f0c46ad6f8

View File

@ -928,9 +928,17 @@ app.classes.mail = AppJS.extend(
*/ */
mail_deleteMessages: function(_msg,_action,_calledFromPopup) 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)]) 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) mail_deleteMessagesShowResult: function(_msg)
{ {
var myMessage = _msg['egw_message']; egw_message(_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();
}, },
/** /**