mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#1272 Optimize performance of context buttons visibility switch
This commit is contained in:
@ -8081,7 +8081,7 @@ jQuery(async function () {
|
|||||||
// Check if the click was outside the relevant elements
|
// Check if the click was outside the relevant elements
|
||||||
if (!$(e.target).closest('.extraMesButtons, .extraMesButtonsHint').length) {
|
if (!$(e.target).closest('.extraMesButtons, .extraMesButtonsHint').length) {
|
||||||
// Transition out the .extraMesButtons first
|
// Transition out the .extraMesButtons first
|
||||||
$('.extraMesButtons').transition({
|
$('.extraMesButtons:visible').transition({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
duration: 150,
|
duration: 150,
|
||||||
easing: 'ease-in-out',
|
easing: 'ease-in-out',
|
||||||
@ -8089,7 +8089,7 @@ jQuery(async function () {
|
|||||||
$(this).hide(); // Hide the .extraMesButtons after the transition
|
$(this).hide(); // Hide the .extraMesButtons after the transition
|
||||||
|
|
||||||
// Transition the .extraMesButtonsHint back in
|
// Transition the .extraMesButtonsHint back in
|
||||||
$('.extraMesButtonsHint').show().transition({
|
$('.extraMesButtonsHint:not(:visible)').show().transition({
|
||||||
opacity: .2,
|
opacity: .2,
|
||||||
duration: 150,
|
duration: 150,
|
||||||
easing: 'ease-in-out'
|
easing: 'ease-in-out'
|
||||||
|
@ -399,6 +399,7 @@ function switchMessageActions() {
|
|||||||
power_user.expand_message_actions = value === null ? false : value == "true";
|
power_user.expand_message_actions = value === null ? false : value == "true";
|
||||||
$("body").toggleClass("expandMessageActions", power_user.expand_message_actions);
|
$("body").toggleClass("expandMessageActions", power_user.expand_message_actions);
|
||||||
$("#expandMessageActions").prop("checked", power_user.expand_message_actions);
|
$("#expandMessageActions").prop("checked", power_user.expand_message_actions);
|
||||||
|
$('.extraMesButtons, .extraMesButtonsHint').removeAttr('style');
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchUiMode() {
|
function switchUiMode() {
|
||||||
|
Reference in New Issue
Block a user