(js) Restrict special mailboxes to the top level

Fixes #6963
This commit is contained in:
Francis Lachapelle
2017-03-22 14:53:07 -04:00
parent e7a06c42a4
commit 75aaef0f3d
3 changed files with 15 additions and 4 deletions
@@ -571,6 +571,16 @@
});
};
/**
* @function $canFolderAs
* @memberof Mailbox.prototype
* @desc Check if the folder can be set as Drafts/Sent/Trash
* @returns true if folder is eligible
*/
Mailbox.prototype.$canFolderAs = function() {
return this.type == 'folder' && this.level === 0;
};
/**
* @function $setFolderAs
* @memberof Mailbox.prototype