From e8909a4f2ffdcf92fb0293dc3075a7886b8a4be0 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Tue, 11 Apr 2023 19:29:12 +0300 Subject: [PATCH] Properly save and restore transition value on long slider shifts --- public/scripts/power-user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 38a7c3fa9..eaacf38c3 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -62,6 +62,9 @@ const storage_keys = { font_scale: "TavernAI_font_scale", }; +const chat = document.getElementById('chat'); +const chatTransition = window.getComputedStyle(chat).transition; + //Updated at the bottom of this script document based on 'focus' and 'blur' events let browser_has_focus = true; @@ -117,8 +120,6 @@ async function applyFontScale() { power_user.font_scale = Number(localStorage.getItem(storage_keys.font_scale) ?? 1); // temporarily unset transition from chat to not make the browser calculate the animation - const chat = document.getElementById('chat'); - const chatTransition = window.getComputedStyle(chat).transition; chat.style.transition = 'unset'; // now apply the font scale to the document