Fix chat width and font scale not applying on manual input
| @@ -10817,7 +10817,7 @@ jQuery(async function () { | |||
| 10817 | //newSlider.val(manualInput) | 10817 | //newSlider.val(manualInput) |
| 10818 | //handleSlideEvent.call(newSlider, null, { value: parseFloat(manualInput) }, 'manual'); | 10818 | //handleSlideEvent.call(newSlider, null, { value: parseFloat(manualInput) }, 'manual'); |
| 10819 | valueBeforeManualInput = manualInput; | 10819 | valueBeforeManualInput = manualInput; |
| 10820 | $(masterElement).val($(this).val()).trigger('input'); | 10820 | $(masterElement).val($(this).val()).trigger('input', { forced: true }); |
| 10821 | } else { | 10821 | } else { |
| 10822 | //if value not ok, warn and reset to last known valid value | 10822 | //if value not ok, warn and reset to last known valid value |
| 10823 | toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`); | 10823 | toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`); |
| @@ -10843,7 +10843,7 @@ jQuery(async function () { | |||
| 10843 | if (manualInput >= Number($(this).attr('min')) && manualInput <= Number($(this).attr('max'))) { | 10843 | if (manualInput >= Number($(this).attr('min')) && manualInput <= Number($(this).attr('max'))) { |
| 10844 | valueBeforeManualInput = manualInput; | 10844 | valueBeforeManualInput = manualInput; |
| 10845 | //set the slider value to input value | 10845 | //set the slider value to input value |
| 10846 | $(masterElement).val($(this).val()).trigger('input'); | 10846 | $(masterElement).val($(this).val()).trigger('input', { forced: true }); |
| 10847 | } else { | 10847 | } else { |
| 10848 | //if value not ok, warn and reset to last known valid value | 10848 | //if value not ok, warn and reset to last known valid value |
| 10849 | toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`); | 10849 | toastr.warning(`Invalid value. Must be between ${$(this).attr('min')} and ${$(this).attr('max')}`); |
| @@ -3328,10 +3328,11 @@ $(document).ready(() => { | |||
| 3328 | 3328 | ||
| 3329 | }); | 3329 | }); |
| 3330 | 3330 | ||
| 3331 | $('#chat_width_slider').on('input', function (e) { | 3331 | $('#chat_width_slider').on('input', function (e, data) { |
| 3332 | const applyMode = data?.forced ? 'forced' : 'normal'; | ||
| 3332 | power_user.chat_width = Number(e.target.value); | 3333 | power_user.chat_width = Number(e.target.value); |
| 3333 | localStorage.setItem(storage_keys.chat_width, power_user.chat_width); | 3334 | localStorage.setItem(storage_keys.chat_width, power_user.chat_width); |
| 3334 | applyChatWidth(); | 3335 | applyChatWidth(applyMode); |
| 3335 | setHotswapsDebounced(); | 3336 | setHotswapsDebounced(); |
| 3336 | }); | 3337 | }); |
| 3337 | 3338 | ||
| @@ -3357,11 +3358,12 @@ $(document).ready(() => { | |||
| 3357 | saveSettingsDebounced(); | 3358 | saveSettingsDebounced(); |
| 3358 | }); | 3359 | }); |
| 3359 | 3360 | ||
| 3360 | $('input[name="font_scale"]').on('input', async function (e) { | 3361 | $('input[name="font_scale"]').on('input', async function (e, data) { |
| 3362 | const applyMode = data?.forced ? 'forced' : 'normal'; | ||
| 3361 | power_user.font_scale = Number(e.target.value); | 3363 | power_user.font_scale = Number(e.target.value); |
| 3362 | $('#font_scale_counter').val(power_user.font_scale); | 3364 | $('#font_scale_counter').val(power_user.font_scale); |
| 3363 | localStorage.setItem(storage_keys.font_scale, power_user.font_scale); | 3365 | localStorage.setItem(storage_keys.font_scale, power_user.font_scale); |
| 3364 | await applyFontScale(); | 3366 | await applyFontScale(applyMode); |
| 3365 | saveSettingsDebounced(); | 3367 | saveSettingsDebounced(); |
| 3366 | }); | 3368 | }); |
| 3367 | 3369 | ||