mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve #464
This commit is contained in:
parent
a5caae8991
commit
cf71c1a18f
3 changed files with 6 additions and 7 deletions
|
|
@ -233,8 +233,8 @@ export class FilterModel extends AbstractModel {
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneSelf() {
|
assignTo(target) {
|
||||||
const filter = new FilterModel();
|
const filter = target || new FilterModel();
|
||||||
|
|
||||||
filter.id = this.id;
|
filter.id = this.id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,12 +102,12 @@ export class SieveScriptPopupView extends rl.pluginPopupView {
|
||||||
filter.generateID();
|
filter.generateID();
|
||||||
FilterPopupView.showModal([
|
FilterPopupView.showModal([
|
||||||
filter,
|
filter,
|
||||||
() => this.filters.push(filter)
|
() => this.filters.push(filter.assignTo())
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
editFilter(filter) {
|
editFilter(filter) {
|
||||||
const clonedFilter = filter.cloneSelf();
|
const clonedFilter = filter.assignTo();
|
||||||
FilterPopupView.showModal([
|
FilterPopupView.showModal([
|
||||||
clonedFilter,
|
clonedFilter,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -115,8 +115,7 @@ export class SieveScriptPopupView extends rl.pluginPopupView {
|
||||||
filters = script.filters(),
|
filters = script.filters(),
|
||||||
index = filters.indexOf(filter);
|
index = filters.indexOf(filter);
|
||||||
if (-1 < index) {
|
if (-1 < index) {
|
||||||
// script.filters.splice(index, 1, clonedFilter);
|
clonedFilter.assignTo(filter);
|
||||||
filters[index] = clonedFilter;
|
|
||||||
script.filters(filters);
|
script.filters(filters);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
data-i18n="POPUPS_FILTER/SELECT_MATCH_ALL"></option>
|
data-i18n="POPUPS_FILTER/SELECT_MATCH_ALL"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div data-bind="visible: conditions().length, foreach: conditions">
|
<div data-bind="foreach: conditions">
|
||||||
<div class="control-group" data-bind="css: {'error': valueError}" style="display:flex">
|
<div class="control-group" data-bind="css: {'error': valueError}" style="display:flex">
|
||||||
<div style="flex-grow:1" data-bind="css: {'error': valueError}, template: {'name': template(), 'data': $data}"></div>
|
<div style="flex-grow:1" data-bind="css: {'error': valueError}, template: {'name': template(), 'data': $data}"></div>
|
||||||
<span class="delete-action button-delete fontastic" style="margin-top: 5px;"
|
<span class="delete-action button-delete fontastic" style="margin-top: 5px;"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue