mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Merged from sub repository (updated ckeditor, filters - step 2)
This commit is contained in:
parent
a57dc3720e
commit
ec7324b061
427 changed files with 10909 additions and 3336 deletions
|
|
@ -26,14 +26,10 @@
|
|||
|
||||
this.name = ko.observable('');
|
||||
|
||||
this.conditionsType = ko.observable(Enums.FilterRulesType.And);
|
||||
this.conditionsType = ko.observable(Enums.FilterRulesType.All);
|
||||
|
||||
this.conditions = ko.observableArray([]);
|
||||
|
||||
this.regDisposables(this.conditions.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
}));
|
||||
|
||||
// Actions
|
||||
this.actionMarkAsRead = ko.observable(false);
|
||||
this.actionSkipOtherFilters = ko.observable(true);
|
||||
|
|
@ -41,18 +37,27 @@
|
|||
|
||||
this.actionType = ko.observable(Enums.FiltersAction.Move);
|
||||
this.actionTypeOptions = [ // TODO i18n
|
||||
{'id': Enums.FiltersAction.None, 'name': 'Action - None'},
|
||||
{'id': Enums.FiltersAction.Move, 'name': 'Action - Move to'},
|
||||
// {'id': Enums.FiltersAction.Forward, 'name': 'Action - Forward to'},
|
||||
{'id': Enums.FiltersAction.Discard, 'name': 'Action - Discard'}
|
||||
{'id': Enums.FiltersAction.None, 'name': 'None'},
|
||||
{'id': Enums.FiltersAction.Move, 'name': ' Move to'},
|
||||
// {'id': Enums.FiltersAction.Forward, 'name': 'Forward to'},
|
||||
{'id': Enums.FiltersAction.Discard, 'name': 'Discard'}
|
||||
];
|
||||
|
||||
this.actionMarkAsReadVisiblity = ko.computed(function () {
|
||||
return -1 < Utils.inArray(this.actionType(), [
|
||||
Enums.FiltersAction.None, Enums.FiltersAction.Forward, Enums.FiltersAction.Move
|
||||
this.enableSkipOtherFilters = ko.computed(function () {
|
||||
return -1 === Utils.inArray(this.actionType(), [
|
||||
Enums.FiltersAction.Move, Enums.FiltersAction.Forward, Enums.FiltersAction.Discard
|
||||
]);
|
||||
}, this);
|
||||
|
||||
this.actionSkipOtherFiltersResult = ko.computed({
|
||||
'read': function () {
|
||||
return this.actionSkipOtherFilters() ||
|
||||
!this.enableSkipOtherFilters();
|
||||
},
|
||||
'write': this.actionSkipOtherFilters,
|
||||
'owner': this
|
||||
});
|
||||
|
||||
this.actionTemplate = ko.computed(function () {
|
||||
|
||||
var sTemplate = '';
|
||||
|
|
@ -75,7 +80,11 @@
|
|||
|
||||
}, this);
|
||||
|
||||
this.regDisposables([this.actionMarkAsReadVisiblity, this.actionTemplate]);
|
||||
this.regDisposables(this.conditions.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
}));
|
||||
|
||||
this.regDisposables([this.enableSkipOtherFilters, this.actionSkipOtherFiltersResult, this.actionTemplate]);
|
||||
}
|
||||
|
||||
_.extend(FilterModel.prototype, AbstractModel.prototype);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue