mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-02 21:12:02 +08: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;
|
||||
}
|
||||
|
||||
cloneSelf() {
|
||||
const filter = new FilterModel();
|
||||
assignTo(target) {
|
||||
const filter = target || new FilterModel();
|
||||
|
||||
filter.id = this.id;
|
||||
|
||||
|
|
|
@ -102,12 +102,12 @@ export class SieveScriptPopupView extends rl.pluginPopupView {
|
|||
filter.generateID();
|
||||
FilterPopupView.showModal([
|
||||
filter,
|
||||
() => this.filters.push(filter)
|
||||
() => this.filters.push(filter.assignTo())
|
||||
]);
|
||||
}
|
||||
|
||||
editFilter(filter) {
|
||||
const clonedFilter = filter.cloneSelf();
|
||||
const clonedFilter = filter.assignTo();
|
||||
FilterPopupView.showModal([
|
||||
clonedFilter,
|
||||
() => {
|
||||
|
@ -115,8 +115,7 @@ export class SieveScriptPopupView extends rl.pluginPopupView {
|
|||
filters = script.filters(),
|
||||
index = filters.indexOf(filter);
|
||||
if (-1 < index) {
|
||||
// script.filters.splice(index, 1, clonedFilter);
|
||||
filters[index] = clonedFilter;
|
||||
clonedFilter.assignTo(filter);
|
||||
script.filters(filters);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
data-i18n="POPUPS_FILTER/SELECT_MATCH_ALL"></option>
|
||||
</select>
|
||||
</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 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;"
|
||||
|
|
Loading…
Reference in a new issue