updating/refreshing tree on mail account changes using new observer method (not yet fully working, probably because of caching in mail backend)

This commit is contained in:
Ralf Becker 2014-05-23 10:11:17 +00:00
parent f5c186c384
commit b00dc896ea

View File

@ -35,7 +35,7 @@ app.classes.mail = AppJS.extend(
mail_currentlyFocussed: '', mail_currentlyFocussed: '',
mail_previewAreaActive: true, // we start with the area active mail_previewAreaActive: true, // we start with the area active
nm_index: 'nm', // nm nome of index nm_index: 'nm', // nm name of index
mail_fileSelectorWindow: null, mail_fileSelectorWindow: null,
mail_isMainWindow: true, mail_isMainWindow: true,
@ -196,8 +196,30 @@ app.classes.mail = AppJS.extend(
} }
break; break;
case 'emailadmin': case 'emailadmin': // update tree with given mail account _id and _type
// ToDo: update tree with given account _id and _type var tree = this.et2.getWidgetById(this.nm_index+'[foldertree]');
if (!tree) break;
var node = tree.getNode(_id);
switch(_type)
{
case 'delete':
if (node) // we dont care for deleted accounts not shown (eg. other users)
{
tree.deleteItem(_id);
// ToDo: blank list, if _id was active account
}
break
case 'update':
case 'edit':
if (node) // we dont care for updated accounts not shown (eg. other users)
{
tree.refreshItem(_id);
}
break;
case 'add':
tree.refreshItem(0); // refresh root
break;
}
} }
}, },