mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Replaced tricky delegateRunOnDestroy() with koArrayWithDestroy()
koArrayWithDestroy creates ko.observableArray and calls the desired onDestroy() on entry delete.
This commit is contained in:
parent
f4bc796fb1
commit
e324e2f6b6
13 changed files with 32 additions and 55 deletions
|
|
@ -2,7 +2,6 @@ import ko from 'ko';
|
|||
|
||||
import { getNotification, i18nToNodes } from 'Common/Translator';
|
||||
import { addObservablesTo } from 'External/ko';
|
||||
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
import { FilterModel } from 'Model/Filter';
|
||||
|
|
@ -78,7 +77,6 @@ class SieveScriptPopupView extends AbstractViewPopup {
|
|||
|
||||
deleteFilter(filter) {
|
||||
this.script().filters.remove(filter);
|
||||
delegateRunOnDestroy(filter);
|
||||
}
|
||||
|
||||
addFilter() {
|
||||
|
|
@ -103,7 +101,6 @@ class SieveScriptPopupView extends AbstractViewPopup {
|
|||
filters = script.filters(),
|
||||
index = filters.indexOf(filter);
|
||||
if (-1 < index) {
|
||||
delegateRunOnDestroy(filters[index]);
|
||||
filters[index] = clonedFilter;
|
||||
script.filters(filters);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue