mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Sieve filters (interface/vacation action)
This commit is contained in:
parent
54edeaa645
commit
68cc322bd5
26 changed files with 235 additions and 104 deletions
|
|
@ -51,9 +51,6 @@
|
|||
|
||||
var
|
||||
self = this,
|
||||
fResizeSub = function () {
|
||||
Utils.windowResize();
|
||||
},
|
||||
fCcAndBccCheckHelper = function (aValue) {
|
||||
if (false === self.showCcAndBcc() && 0 < aValue.length)
|
||||
{
|
||||
|
|
@ -134,8 +131,8 @@
|
|||
|
||||
this.attachmentsPlace = ko.observable(false);
|
||||
|
||||
this.attachments.subscribe(fResizeSub);
|
||||
this.attachmentsPlace.subscribe(fResizeSub);
|
||||
this.attachments.subscribe(Utils.windowResizeCallback);
|
||||
this.attachmentsPlace.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
this.attachmentsInErrorCount.subscribe(function (iN) {
|
||||
if (0 === iN)
|
||||
|
|
|
|||
|
|
@ -178,13 +178,8 @@
|
|||
this.reloadContactList();
|
||||
}, this);
|
||||
|
||||
this.contacts.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
}, this);
|
||||
|
||||
this.viewProperties.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
}, this);
|
||||
this.contacts.subscribe(Utils.windowResizeCallback);
|
||||
this.viewProperties.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
this.contactsChecked = ko.computed(function () {
|
||||
return _.filter(this.contacts(), function (oItem) {
|
||||
|
|
@ -745,7 +740,7 @@
|
|||
if (this.bBackToCompose)
|
||||
{
|
||||
this.bBackToCompose = false;
|
||||
|
||||
|
||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,31 +30,33 @@
|
|||
this.fTrueCallback = null;
|
||||
this.filter = ko.observable(null);
|
||||
|
||||
this.selectedFolderValue = ko.observable(Consts.Values.UnuseOptionValue);
|
||||
this.folderSelectList = Data.folderMenuForFilters;
|
||||
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
||||
this.folderSelectList = Data.folderMenuForFilters;
|
||||
this.selectedFolderValue = ko.observable('');
|
||||
|
||||
this.selectedFolderValue.subscribe(function() {
|
||||
if (this.filter())
|
||||
{
|
||||
this.filter().actionValue.error(false);
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.saveFilter = Utils.createCommand(this, function () {
|
||||
|
||||
if (this.filter())
|
||||
{
|
||||
if ('' === this.filter().name())
|
||||
if (Enums.FiltersAction.MoveTo === this.filter().actionType())
|
||||
{
|
||||
this.filter().actionValue(this.selectedFolderValue());
|
||||
}
|
||||
|
||||
if (!this.filter().verify())
|
||||
{
|
||||
this.filter().name.error(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.fTrueCallback)
|
||||
{
|
||||
if (Enums.FiltersAction.MoveTo === this.filter().actionType())
|
||||
{
|
||||
this.filter().actionValue(this.selectedFolderValue());
|
||||
}
|
||||
else if (Enums.FiltersAction.Forward !== this.filter().actionType())
|
||||
{
|
||||
this.filter().actionValue('');
|
||||
}
|
||||
|
||||
this.fTrueCallback(this.filter());
|
||||
}
|
||||
|
||||
|
|
@ -68,9 +70,10 @@
|
|||
});
|
||||
|
||||
this.actionTypeOptions = [
|
||||
{'id': Enums.FiltersAction.None, 'name': 'None @i18n'},
|
||||
// {'id': Enums.FiltersAction.None, 'name': 'None @i18n'},
|
||||
{'id': Enums.FiltersAction.MoveTo, 'name': ' Move to @i18n'},
|
||||
{'id': Enums.FiltersAction.Forward, 'name': 'Forward to @i18n'},
|
||||
{'id': Enums.FiltersAction.Vacation, 'name': 'Vacation message @i18n'},
|
||||
{'id': Enums.FiltersAction.Discard, 'name': 'Discard @i18n'}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -292,12 +292,7 @@
|
|||
Utils.windowResize();
|
||||
});
|
||||
|
||||
this.messageLoadingThrottle.subscribe(function (bV) {
|
||||
if (bV)
|
||||
{
|
||||
Utils.windowResize();
|
||||
}
|
||||
});
|
||||
this.messageLoadingThrottle.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
this.goUpCommand = Utils.createCommand(this, function () {
|
||||
Events.pub('mailbox.message-list.selector.go-up');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue