Глобальный рефакторинг SettingsPage (в процессе)

This commit is contained in:
Book Pauk
2022-10-12 21:45:40 +07:00
parent 528b32ccf7
commit 419b203fcf
4 changed files with 352 additions and 155 deletions

View File

@@ -163,10 +163,10 @@ const componentOptions = {
},
watch: {
form() {
this.formChanged();
this.formChanged();//no await
},
dualDivColorFiltered(newValue) {
if (this.helper.isHexColor(newValue))
if (!this.isFormChanged && this.helper.isHexColor(newValue))
this.form.dualDivColor = newValue;
},
}
@@ -180,17 +180,29 @@ class Mode {
helper = helper;
defPalette = defPalette;
isFormChanged = false;
dualDivColorFiltered = '';
created() {
this.formChanged();
this.formChanged();//no await
}
mounted() {
}
formChanged() {
this.dualDivColorFiltered = this.form.dualDivColor;
async formChanged() {
this.isFormChanged = true;
try {
this.dualDivColorFiltered = this.form.dualDivColor;
if (this.form.dualPageMode
&& (this.form.pageChangeAnimation == 'flip' || this.form.pageChangeAnimation == 'rightShift')
)
this.form.pageChangeAnimation = '';
} finally {
await this.$nextTick();
this.isFormChanged = false;
}
}
}