More improvements to view Sieve Scripts.

This commit is contained in:
djmaze 2021-01-18 23:52:15 +01:00
parent d1f9249ac1
commit a31834458b
5 changed files with 93 additions and 155 deletions

View file

@ -19,8 +19,12 @@ class SieveScriptPopupView extends AbstractViewNext {
constructor() {
super();
// this.filters = FilterStore.filters;
this.filters = ko.observableArray([]);
this.filters.loading = ko.observable(false).extend({ throttle: 200 });
this.filters.saving = ko.observable(false).extend({ throttle: 200 });
this.modules = FilterStore.modules;
this.filters = FilterStore.filters;
this.script = {
filters: FilterStore.filters,
@ -29,17 +33,16 @@ class SieveScriptPopupView extends AbstractViewNext {
ko.addObservablesTo(this, {
isNew: true,
inited: false,
serverError: false,
serverErrorDesc: '',
saveErrorText: '',
haveChanges: false,
saveErrorText: ''
filterRaw: ''
});
this.serverError.subscribe(value => value || this.serverErrorDesc(''), this);
this.filterRaw = FilterStore.raw;
// this.filterRaw = FilterStore.raw;
this.filterRaw.capa = FilterStore.capa;
this.filterRaw.active = ko.observable(false);
this.filterRaw.allow = ko.observable(false);
@ -148,6 +151,10 @@ class SieveScriptPopupView extends AbstractViewNext {
this.fTrueCallback = fTrueCallback;
this.filters(oScript.filters());
this.filterRaw(oScript.body());
this.filterRaw.active(!oScript.allowFilters());
this.filterRaw.error(false);
this.isNew(!bEdit);
if (!bEdit && oScript) {