فهرست منبع

Поправки багов

Book Pauk 4 سال پیش
والد
کامیت
a63602df7a
1فایلهای تغییر یافته به همراه13 افزوده شده و 3 حذف شده
  1. 13 3
      client/components/Reader/SettingsPage/SettingsPage.vue

+ 13 - 3
client/components/Reader/SettingsPage/SettingsPage.vue

@@ -108,8 +108,10 @@ export default @Component({
         },
         },
         vertShift: function(newValue) {
         vertShift: function(newValue) {
             const font = (this.webFontName ? this.webFontName : this.fontName);
             const font = (this.webFontName ? this.webFontName : this.fontName);
-            this.fontShifts = Object.assign({}, this.fontShifts, {[font]: newValue});
-            this.fontVertShift = newValue;
+            if (this.fontShifts[font] != newValue) {
+                this.fontShifts = Object.assign({}, this.fontShifts, {[font]: newValue});
+                this.fontVertShift = newValue;
+            }
         },
         },
         fontName: function(newValue) {
         fontName: function(newValue) {
             const font = (this.webFontName ? this.webFontName : newValue);
             const font = (this.webFontName ? this.webFontName : newValue);
@@ -185,10 +187,18 @@ class SettingsPage extends Vue {
     settingsChanged() {
     settingsChanged() {
         if (_.isEqual(this.form, this.settings))
         if (_.isEqual(this.form, this.settings))
             return;
             return;
+
         this.form = Object.assign({}, this.settings);
         this.form = Object.assign({}, this.settings);
+        if (!this.unwatch)
+            this.unwatch = {};
+
         for (let prop in rstore.settingDefaults) {
         for (let prop in rstore.settingDefaults) {
+            if (this.unwatch && this.unwatch[prop])
+                this.unwatch[prop]();
+
             this[prop] = this.form[prop];
             this[prop] = this.form[prop];
-            this.$watch(prop, (newValue) => {
+
+            this.unwatch[prop] = this.$watch(prop, (newValue) => {
                 this.form = Object.assign({}, this.form, {[prop]: newValue});
                 this.form = Object.assign({}, this.form, {[prop]: newValue});
             });
             });
         }
         }