OpenPGP (#53) Beta

Archive  (Closes #110)
Delete, Spam and Archive button in mail view when preview pane is off  (Closes #72)
Small fixes  (Closes #101)
This commit is contained in:
RainLoop Team
2014-04-02 03:58:24 +04:00
parent ab817e1396
commit cae0cc2f77
45 changed files with 1390 additions and 172 deletions

View File

@@ -109,15 +109,26 @@ function MailBoxMessageListViewModel()
}, this);
this.isSpamFolder = ko.computed(function () {
return RL.data().spamFolder() === this.messageListEndFolder();
return oData.spamFolder() === this.messageListEndFolder() &&
'' !== oData.spamFolder();
}, this);
this.isSpamDisabled = ko.computed(function () {
return Consts.Values.UnuseOptionValue === RL.data().spamFolder();
return Consts.Values.UnuseOptionValue === oData.spamFolder();
}, this);
this.isTrashFolder = ko.computed(function () {
return RL.data().trashFolder() === this.messageListEndFolder();
return oData.trashFolder() === this.messageListEndFolder() &&
'' !== oData.trashFolder();
}, this);
this.isArchiveFolder = ko.computed(function () {
return oData.archiveFolder() === this.messageListEndFolder() &&
'' !== oData.archiveFolder();
}, this);
this.isArchiveDisabled = ko.computed(function () {
return Consts.Values.UnuseOptionValue === RL.data().archiveFolder();
}, this);
this.canBeMoved = this.hasCheckedOrSelectedLines;
@@ -141,6 +152,12 @@ function MailBoxMessageListViewModel()
RL.data().currentFolderFullNameRaw(),
RL.data().messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved);
this.archiveCommand = Utils.createCommand(this, function () {
RL.deleteMessagesFromFolder(Enums.FolderType.Archive,
RL.data().currentFolderFullNameRaw(),
RL.data().messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved);
this.spamCommand = Utils.createCommand(this, function () {
RL.deleteMessagesFromFolder(Enums.FolderType.Spam,
@@ -219,6 +236,15 @@ MailBoxMessageListViewModel.prototype.searchEnterAction = function ()
this.inputMessageListSearchFocus(false);
};
/**
* @returns {string}
*/
MailBoxMessageListViewModel.prototype.printableMessageCountForDeletion = function ()
{
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : '';
};
MailBoxMessageListViewModel.prototype.cancelSearch = function ()
{
this.mainMessageListSearch('');