Shuffle some stuff around so switching folders works too.

This commit is contained in:
Nathan Gray 2013-12-10 18:13:28 +00:00
parent 1f438436e1
commit 46253ec346

View File

@ -997,16 +997,8 @@ app.classes.mail = AppJS.extend(
*/ */
mail_changeProfile: function(folder,_widget) { mail_changeProfile: function(folder,_widget) {
// alert(folder); // alert(folder);
var nm = _widget.getRoot().getWidgetById(this.nm_index);
if(nm)
{
nm.activeFilters['selectedFolder'] = folder;
// Changing dataset entirely, force a reset
nm.controller.reset();
}
egw.json('mail.mail_ui.ajax_changeProfile',[folder]) egw.json('mail.mail_ui.ajax_changeProfile',[folder])
.sendRequest(); .sendRequest();
this.mail_refreshMessageGrid();
return true; return true;
}, },
@ -1026,12 +1018,8 @@ app.classes.mail = AppJS.extend(
if (!(img.search(eval('/'+'thunderbird'+'/'))<0)) if (!(img.search(eval('/'+'thunderbird'+'/'))<0))
{ {
rv = this.mail_changeProfile(folder,_widget); rv = this.mail_changeProfile(folder,_widget);
if (rv)
{
return rv;
} }
} else if (_widget.event_args.length==2)
if (_widget.event_args.length==2)
{ {
folder = _widget.event_args[1]; folder = _widget.event_args[1];
_widget.set_value(folder); _widget.set_value(folder);
@ -1042,11 +1030,12 @@ app.classes.mail = AppJS.extend(
} }
} }
var nm = _widget.getRoot().getWidgetById(this.nm_index); var nm = _widget.getRoot().getWidgetById(this.nm_index);
nm.activeFilters["selectedFolder"] = folder; if(nm)
//nm.applyFilters();// its done in refrefreshMessageGrid
var msg = _widget.getRoot().getWidgetById('msg');
if (msg)
{ {
nm.activeFilters['selectedFolder'] = folder;
// Changing dataset entirely, force a reset
nm.controller.reset();
}
window.clearInterval(this.doStatus); window.clearInterval(this.doStatus);
displayname = _widget.getSelectedLabel(); displayname = _widget.getSelectedLabel();
inBraket = displayname.search(/\(/); inBraket = displayname.search(/\(/);
@ -1061,8 +1050,8 @@ app.classes.mail = AppJS.extend(
} }
} }
myMsg = (displayname?displayname:folder)+' '+this.egw.lang('selected'); myMsg = (displayname?displayname:folder)+' '+this.egw.lang('selected');
app.mail.app_refresh(myMsg, 'mail'); egw_message(myMsg);
}
//mail_refreshMessageGrid();// its done in refreshFolderStatus already //mail_refreshMessageGrid();// its done in refreshFolderStatus already
this.mail_refreshFolderStatus(folder,'forced'); this.mail_refreshFolderStatus(folder,'forced');
this.mail_refreshQuotaDisplay(server[0]); this.mail_refreshQuotaDisplay(server[0]);