Unlock the mail tree after move/copy actions

This commit is contained in:
Hadi Nategh 2014-07-14 16:01:28 +00:00
parent 37275f253b
commit 9086a0e2eb

View File

@ -1586,6 +1586,7 @@ app.classes.mail = AppJS.extend(
case "cancel": case "cancel":
rv = 'cancel'; rv = 'cancel';
} }
if (rv !="cancel") that.lock_tree();
switch (_action.id) switch (_action.id)
{ {
case "delete": case "delete":
@ -1612,7 +1613,6 @@ app.classes.mail = AppJS.extend(
if (_action.id.substr(0,4)=='move') that.mail_callMove(_action, _elems,_target, rv); if (_action.id.substr(0,4)=='move') that.mail_callMove(_action, _elems,_target, rv);
if (_action.id.substr(0,4)=='copy') that.mail_callCopy(_action, _elems,_target, rv); if (_action.id.substr(0,4)=='copy') that.mail_callCopy(_action, _elems,_target, rv);
} }
if (rv !="cancel") that.lock_tree();
}, },
messageToDisplay, messageToDisplay,
this.egw.lang("Confirm"), this.egw.lang("Confirm"),
@ -2579,12 +2579,10 @@ app.classes.mail = AppJS.extend(
/** /**
* mail_move2folder - implementation of the move action from action menu * mail_move2folder - implementation of the move action from action menu
* *
* @param _action * @param _action _action.id holds folder target information
* @param _elems - the representation of the elements to be affected * @param _elems - the representation of the elements to be affected
*/ */
mail_move2folder: function(_action, _elems) { mail_move2folder: function(_action, _elems) {
//alert('Copy or Move Called:'+_action.id);
// _action.id holds folder target information
this.mail_move(_action, _elems, null); this.mail_move(_action, _elems, null);
}, },
@ -2611,14 +2609,13 @@ app.classes.mail = AppJS.extend(
var target = _action.id == 'drop_move_mail' ? _target.iface.id : _action.id.substr(5); var target = _action.id == 'drop_move_mail' ? _target.iface.id : _action.id.substr(5);
var messages = this.mail_getFormData(_senders); var messages = this.mail_getFormData(_senders);
if (typeof _allMessagesChecked=='undefined') _allMessagesChecked=false; if (typeof _allMessagesChecked=='undefined') _allMessagesChecked=false;
//alert('mail_move('+messages.msg.join(',')+' --> '+target+')');
// TODO: Write move/copy function which cares about doing the same stuff // TODO: Write move/copy function which cares about doing the same stuff
// as the "onNodeSelect" function! // as the "onNodeSelect" function!
messages['all'] = _allMessagesChecked; messages['all'] = _allMessagesChecked;
if (messages['all']=='cancel') return false; if (messages['all']=='cancel') return false;
if (messages['all']) messages['activeFilters'] = this.mail_getActiveFilters(_action); if (messages['all']) messages['activeFilters'] = this.mail_getActiveFilters(_action);
var self = this;
egw.json('mail.mail_ui.ajax_copyMessages',[target, messages, 'move']) egw.json('mail.mail_ui.ajax_copyMessages',[target, messages, 'move'], function(){self.unlock_tree();})
.sendRequest(); .sendRequest();
var nm = this.et2.getWidgetById(this.nm_index); var nm = this.et2.getWidgetById(this.nm_index);
this.mail_setRowClass(_senders,'deleted'); this.mail_setRowClass(_senders,'deleted');
@ -2648,14 +2645,13 @@ app.classes.mail = AppJS.extend(
var target = _action.id == 'drop_copy_mail' ? _target.iface.id : _action.id.substr(5); var target = _action.id == 'drop_copy_mail' ? _target.iface.id : _action.id.substr(5);
var messages = this.mail_getFormData(_senders); var messages = this.mail_getFormData(_senders);
if (typeof _allMessagesChecked=='undefined') _allMessagesChecked=false; if (typeof _allMessagesChecked=='undefined') _allMessagesChecked=false;
//alert('mail_copy('+messages.msg.join(',')+' --> '+target+')');
// TODO: Write move/copy function which cares about doing the same stuff // TODO: Write move/copy function which cares about doing the same stuff
// as the "onNodeSelect" function! // as the "onNodeSelect" function!
messages['all'] = _allMessagesChecked; messages['all'] = _allMessagesChecked;
if (messages['all']=='cancel') return false; if (messages['all']=='cancel') return false;
if (messages['all']) messages['activeFilters'] = this.mail_getActiveFilters(_action); if (messages['all']) messages['activeFilters'] = this.mail_getActiveFilters(_action);
var self = this;
egw.json('mail.mail_ui.ajax_copyMessages',[target, messages]) egw.json('mail.mail_ui.ajax_copyMessages',[target, messages],function (){self.unlock_tree();})
.sendRequest(); .sendRequest();
// Server response contains refresh // Server response contains refresh
}, },