bugfixes so apply doesnt reverse settings on first pageload when initing csstogglers

merge-requests/208/head
fatchan 4 years ago
parent b367c021ee
commit 036bcd3c94
  1. 9
      gulp/res/js/hide.js
  2. 6
      package-lock.json

@ -115,10 +115,15 @@ class CssToggle {
this.toggle(); this.toggle();
}, false); }, false);
}); });
this.toggle(); this.apply();
} }
toggle () { toggle () {
this.settingBoolean = !this.settingBoolean; this.settingBoolean = !this.settingBoolean;
console.log('toggling', this.localStorageKey, this.settingBoolean);
this.apply();
setLocalStorage(this.localStorageKey, this.settingBoolean);
}
apply () {
if (this.settingBoolean) { if (this.settingBoolean) {
renderSheet.insertRule(this.settingCss); renderSheet.insertRule(this.settingCss);
} else { } else {
@ -128,8 +133,6 @@ class CssToggle {
} }
} }
} }
console.log('toggling', this.localStorageKey, this.settingBoolean);
setLocalStorage(this.localStorageKey, this.settingBoolean);
} }
}; };

6
package-lock.json generated

@ -226,7 +226,7 @@
} }
}, },
"@tohru/gm": { "@tohru/gm": {
"version": "github:fatchan/gm#c2ffb2ce0db3f64fbf4082462601429985b6dca6", "version": "github:fatchan/gm#07df8fbf131b6b18c32fa010a84e67964e132955",
"from": "github:fatchan/gm", "from": "github:fatchan/gm",
"requires": { "requires": {
"array-parallel": "^0.1.3", "array-parallel": "^0.1.3",
@ -2406,7 +2406,7 @@
} }
}, },
"express-fileupload": { "express-fileupload": {
"version": "github:fatchan/express-fileupload#fd713ae7a3c7f381638d6479faa142d366304329", "version": "github:fatchan/express-fileupload#f72901fd27b615664ca30fc4c4148b62c5c77fe9",
"from": "github:fatchan/express-fileupload", "from": "github:fatchan/express-fileupload",
"requires": { "requires": {
"busboy": "^0.3.1" "busboy": "^0.3.1"
@ -3612,7 +3612,7 @@
} }
}, },
"gm": { "gm": {
"version": "github:fatchan/gm#c2ffb2ce0db3f64fbf4082462601429985b6dca6", "version": "github:fatchan/gm#07df8fbf131b6b18c32fa010a84e67964e132955",
"from": "github:fatchan/gm", "from": "github:fatchan/gm",
"requires": { "requires": {
"array-parallel": "^0.1.3", "array-parallel": "^0.1.3",

Loading…
Cancel
Save