From ea4ba57408869eb1dbecd7189ec5ad060cddc915 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sat, 30 Mar 2024 05:41:54 +0100 Subject: [PATCH] Fix horizontal scrollbar appearing in popups - Fix that annoying horizontal scrollbar appearing in popups, e.g. the tag popup when you drag tags around - Still provide possibility to make popups actually utilize scrollbars --- public/script.js | 7 ++++--- public/style.css | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/script.js b/public/script.js index 9df870852..9057cfec3 100644 --- a/public/script.js +++ b/public/script.js @@ -6810,18 +6810,19 @@ function onScenarioOverrideRemoveClick() { * @param {string} type * @param {string} inputValue - Value to set the input to. * @param {PopupOptions} options - Options for the popup. - * @typedef {{okButton?: string, rows?: number, wide?: boolean, large?: boolean }} PopupOptions - Options for the popup. + * @typedef {{okButton?: string, rows?: number, wide?: boolean, large?: boolean, allowHorizontalScrolling?: boolean, allowVerticalScrolling?: boolean }} PopupOptions - Options for the popup. * @returns */ -function callPopup(text, type, inputValue = '', { okButton, rows, wide, large } = {}) { +function callPopup(text, type, inputValue = '', { okButton, rows, wide, large, allowHorizontalScrolling, allowVerticalScrolling } = {}) { dialogueCloseStop = true; if (type) { popup_type = type; } $('#dialogue_popup').toggleClass('wide_dialogue_popup', !!wide); - $('#dialogue_popup').toggleClass('large_dialogue_popup', !!large); + $('#dialogue_popup').toggleClass('horizontal_scrolling_dialogue_popup', !!allowHorizontalScrolling); + $('#dialogue_popup').toggleClass('vertical_scrolling_dialogue_popup', !!allowVerticalScrolling); $('#dialogue_popup_cancel').css('display', 'inline-block'); switch (popup_type) { diff --git a/public/style.css b/public/style.css index e6218e820..90c04de9f 100644 --- a/public/style.css +++ b/public/style.css @@ -2081,6 +2081,7 @@ grammarly-extension { display: flex; flex-direction: column; overflow-y: hidden; + overflow-x: hidden; } .rm_stat_block { @@ -2101,6 +2102,14 @@ grammarly-extension { min-width: var(--sheldWidth); } +.horizontal_scrolling_dialogue_popup { + overflow-x: unset !important; +} + +.vertical_scrolling_dialogue_popup { + overflow-y: unset !important; +} + #bulk_tag_popup_holder, #dialogue_popup_holder { display: flex;