コード例 #1
0
		this.isIncompleteChecked = ko.computed(function () {
			var
				iM = Data.messageList().length,
				iC = Data.messageListChecked().length
			;
			return 0 < iM && 0 < iC && iM > iC;
		}, this);
コード例 #2
0
ファイル: General.js プロジェクト: morfi/rainloop-webmail
			Data.layout.subscribe(function (nValue) {

				Data.messageList([]);

				Remote.saveSettings(null, {
					'Layout': nValue
				});
			});
コード例 #3
0
ファイル: General.js プロジェクト: morfi/rainloop-webmail
			Data.useThreads.subscribe(function (bValue) {

				Data.messageList([]);

				Remote.saveSettings(null, {
					'UseThreads': bValue ? '1' : '0'
				});
			});
コード例 #4
0
	MessageListMailBoxAppView.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction)
	{
		var
			oFolder = null,
			aMessages = Data.messageList()
		;

		if ('' !== sFolderFullNameRaw)
		{
			oFolder = Cache.getFolderFromCacheList(sFolderFullNameRaw);

			if (oFolder)
			{
				switch (iSetAction) {
				case Enums.MessageSetAction.SetSeen:
					oFolder = Cache.getFolderFromCacheList(sFolderFullNameRaw);
					if (oFolder)
					{
						_.each(aMessages, function (oMessage) {
							oMessage.unseen(false);
						});

						oFolder.messageCountUnread(0);
						Cache.clearMessageFlagsFromCacheByFolder(sFolderFullNameRaw);
					}

					Remote.messageSetSeenToAll(Utils.emptyFunction, sFolderFullNameRaw, true);
					break;
				case Enums.MessageSetAction.UnsetSeen:
					oFolder = Cache.getFolderFromCacheList(sFolderFullNameRaw);
					if (oFolder)
					{
						_.each(aMessages, function (oMessage) {
							oMessage.unseen(true);
						});

						oFolder.messageCountUnread(oFolder.messageCountAll());
						Cache.clearMessageFlagsFromCacheByFolder(sFolderFullNameRaw);
					}
					Remote.messageSetSeenToAll(Utils.emptyFunction, sFolderFullNameRaw, false);
					break;
				}

				require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
			}
		}
	};
コード例 #5
0
		this.clearCommand = Utils.createCommand(this, function () {

			var
				self = this,
				oFolderToClear = this.selectedFolder()
			;

			if (oFolderToClear)
			{
				Data.message(null);
				Data.messageList([]);

				this.clearingProcess(true);

				oFolderToClear.messageCountAll(0);
				oFolderToClear.messageCountUnread(0);

				Cache.setFolderHash(oFolderToClear.fullNameRaw, '');

				Remote.folderClear(function (sResult, oData) {

					self.clearingProcess(false);
					if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
					{
						require('App/App').reloadMessageList(true);
						self.cancelCommand();
					}
					else
					{
						if (oData && oData.ErrorCode)
						{
							self.clearingError(Utils.getNotification(oData.ErrorCode));
						}
						else
						{
							self.clearingError(Utils.getNotification(Enums.Notification.MailServerError));
						}
					}
				}, oFolderToClear.fullNameRaw);
			}

		}, function () {
コード例 #6
0
			'write': function (bValue) {
				bValue = !!bValue;
				_.each(Data.messageList(), function (oMessage) {
					oMessage.checked(bValue);
				});
			}