mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix range validation error
This commit is contained in:
@ -700,7 +700,7 @@ async function switchZenSliders() {
|
|||||||
.on('mouseup blur', function () {
|
.on('mouseup blur', function () {
|
||||||
let manualInput = parseFloat(handle.text()).toFixed(decimals)
|
let manualInput = parseFloat(handle.text()).toFixed(decimals)
|
||||||
if (isManualInput) {
|
if (isManualInput) {
|
||||||
//disallow manual inputs outside acceptable range
|
//disallow manual inputs outside acceptable range
|
||||||
if (manualInput >= sliderMin && manualInput <= sliderMax) {
|
if (manualInput >= sliderMin && manualInput <= sliderMax) {
|
||||||
//if value is ok, assign to slider and update handle text and position
|
//if value is ok, assign to slider and update handle text and position
|
||||||
newSlider.val(manualInput)
|
newSlider.val(manualInput)
|
||||||
@ -1476,10 +1476,11 @@ function switchMaxContextSize() {
|
|||||||
const steps = power_user.max_context_unlocked ? unlockedMaxContextStep : maxContextStep;
|
const steps = power_user.max_context_unlocked ? unlockedMaxContextStep : maxContextStep;
|
||||||
|
|
||||||
for (const element of elements) {
|
for (const element of elements) {
|
||||||
|
const id = element.attr('id');
|
||||||
element.attr('max', maxValue);
|
element.attr('max', maxValue);
|
||||||
element.attr('step', steps);
|
element.attr('step', steps);
|
||||||
|
|
||||||
if (element.attr('id').indexOf('max_context') !== -1) {
|
if (typeof id === 'string' && id?.indexOf('max_context') !== -1) {
|
||||||
element.attr('min', minValue);
|
element.attr('min', minValue);
|
||||||
}
|
}
|
||||||
const value = Number(element.val());
|
const value = Number(element.val());
|
||||||
|
Reference in New Issue
Block a user