mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix chat width and font scale not applying on manual input
This commit is contained in:
@ -10817,7 +10817,7 @@ jQuery(async function () {
|
|||||||
//newSlider.val(manualInput)
|
//newSlider.val(manualInput)
|
||||||
//handleSlideEvent.call(newSlider, null, { value: parseFloat(manualInput) }, 'manual');
|
//handleSlideEvent.call(newSlider, null, { value: parseFloat(manualInput) }, 'manual');
|
||||||
valueBeforeManualInput = manualInput;
|
valueBeforeManualInput = manualInput;
|
||||||
$(masterElement).val($(this).val()).trigger('input');
|
$(masterElement).val($(this).val()).trigger('input', { forced: true });
|
||||||
} else {
|
} else {
|
||||||
//if value not ok, warn and reset to last known valid value
|
//if value not ok, warn and reset to last known valid value
|
||||||
toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`);
|
toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`);
|
||||||
@ -10843,7 +10843,7 @@ jQuery(async function () {
|
|||||||
if (manualInput >= Number($(this).attr('min')) && manualInput <= Number($(this).attr('max'))) {
|
if (manualInput >= Number($(this).attr('min')) && manualInput <= Number($(this).attr('max'))) {
|
||||||
valueBeforeManualInput = manualInput;
|
valueBeforeManualInput = manualInput;
|
||||||
//set the slider value to input value
|
//set the slider value to input value
|
||||||
$(masterElement).val($(this).val()).trigger('input');
|
$(masterElement).val($(this).val()).trigger('input', { forced: true });
|
||||||
} else {
|
} else {
|
||||||
//if value not ok, warn and reset to last known valid value
|
//if value not ok, warn and reset to last known valid value
|
||||||
toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`);
|
toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`);
|
||||||
|
@ -3328,10 +3328,11 @@ $(document).ready(() => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#chat_width_slider').on('input', function (e) {
|
$('#chat_width_slider').on('input', function (e, data) {
|
||||||
|
const applyMode = data?.forced ? 'forced' : 'normal';
|
||||||
power_user.chat_width = Number(e.target.value);
|
power_user.chat_width = Number(e.target.value);
|
||||||
localStorage.setItem(storage_keys.chat_width, power_user.chat_width);
|
localStorage.setItem(storage_keys.chat_width, power_user.chat_width);
|
||||||
applyChatWidth();
|
applyChatWidth(applyMode);
|
||||||
setHotswapsDebounced();
|
setHotswapsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -3357,11 +3358,12 @@ $(document).ready(() => {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[name="font_scale"]').on('input', async function (e) {
|
$('input[name="font_scale"]').on('input', async function (e, data) {
|
||||||
|
const applyMode = data?.forced ? 'forced' : 'normal';
|
||||||
power_user.font_scale = Number(e.target.value);
|
power_user.font_scale = Number(e.target.value);
|
||||||
$('#font_scale_counter').val(power_user.font_scale);
|
$('#font_scale_counter').val(power_user.font_scale);
|
||||||
localStorage.setItem(storage_keys.font_scale, power_user.font_scale);
|
localStorage.setItem(storage_keys.font_scale, power_user.font_scale);
|
||||||
await applyFontScale();
|
await applyFontScale(applyMode);
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user