diff --git a/public/index.html b/public/index.html index d8296c1fb..32723dd05 100644 --- a/public/index.html +++ b/public/index.html @@ -4183,7 +4183,7 @@ - Swipe # for All Messages + Swipe # for All Messages diff --git a/public/script.js b/public/script.js index f803ac4f8..c7744984e 100644 --- a/public/script.js +++ b/public/script.js @@ -98,7 +98,6 @@ import { resetMovableStyles, forceCharacterEditorTokenize, applyPowerUserSettings, - switchSwipeNumAllMessages, } from './scripts/power-user.js'; import { @@ -7660,14 +7659,12 @@ export function showSwipeButtons() { //allows for writing individual swipe counters for past messages const lastSwipeCounter = $('.last_mes .swipes-counter'); lastSwipeCounter.text(swipeCounterText).show(); - - switchSwipeNumAllMessages(); } export function hideSwipeButtons() { - $('#chat').find('.swipe_right').hide(); - $('#chat').find('.last_mes .swipes-counter').hide(); - $('#chat').find('.swipe_left').hide(); + chatElement.find('.swipe_right').hide(); + chatElement.find('.last_mes .swipes-counter').hide(); + chatElement.find('.swipe_left').hide(); } /** @@ -8538,6 +8535,8 @@ const swipe_right = () => { } if (run_generate) { //hide swipe arrows while generating this_div.css('display', 'none'); + const swipesCounter = currentMessage.find('.swipes-counter'); + swipesCounter.hide(); } // handles animated transitions when swipe right, specifically height transitions between messages if (run_generate || run_swipe_right) { diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index e27a90fbc..a2ee59e15 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -472,9 +472,9 @@ function switchCompactInputArea() { $('#compact_input_area').prop('checked', power_user.compact_input_area); } -export function switchSwipeNumAllMessages() { +function switchSwipeNumAllMessages() { $('#show_swipe_num_all_messages').prop('checked', power_user.show_swipe_num_all_messages); - $('.mes:not(.last_mes) .swipes-counter').css('opacity', '').toggle(power_user.show_swipe_num_all_messages); + $('body').toggleClass('swipeAllMessages', !!power_user.show_swipe_num_all_messages); } var originalSliderValues = []; diff --git a/public/style.css b/public/style.css index 69ff17b49..b147f9c87 100644 --- a/public/style.css +++ b/public/style.css @@ -1044,6 +1044,16 @@ body .panelControlBar { opacity: 0.3; } +body:not(.swipeAllMessages) .mes:not(.last_mes) .swipes-counter { + display: none; +} + +body.swipeAllMessages .mes:not(.last_mes) .swipes-counter { + /* Avoid expensive DOM queries */ + opacity: 0.3 !important; + display: flex !important; +} + .swipe_left { right: auto; left: 20px;