From afb390dc3739902606217cccf2c40c8655288f25 Mon Sep 17 00:00:00 2001 From: Ivan Polyakov Date: Thu, 12 May 2022 21:22:31 +0300 Subject: [PATCH] scrollbar script fix --- src/scripts/webapps/scrollbar.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/scripts/webapps/scrollbar.js b/src/scripts/webapps/scrollbar.js index fcfa9bc..c266428 100644 --- a/src/scripts/webapps/scrollbar.js +++ b/src/scripts/webapps/scrollbar.js @@ -109,9 +109,11 @@ this.thumb.init(); this.track.init(); }, - upd(el) { + updStyle(el) { el.style = this.bar.getStyle() + this.thumb.getStyle() + this.track.getStyle(); + }, + updData() { this.print(); this.updateUrl(); }, @@ -147,12 +149,6 @@ url = url.replace(/\#/g, "%23"); window.location.href = url; - try { - throw ""; - history.pushState(null, null, url); - } catch { - window.location.href = url; - } }, showScss() { this.output.style = "display:block;" @@ -174,7 +170,7 @@ settingsForm.init(); - updBtn.onclick = settingsForm.upd.bind(settingsForm, textArea); + updBtn.onclick = settingsForm.updData.bind(settingsForm); printBtn.onclick = settingsForm.showScss.bind(settingsForm); clearBtn.onclick = settingsForm.hideScss.bind(settingsForm); @@ -198,8 +194,9 @@ } } }); + settingsForm.updStyle(textArea); if (updNeeded) { - settingsForm.upd(textArea); + settingsForm.updData(); } })(); // @license-end