From 153a066fbe9ff0bdec7cb9d7051a69306bbe1d78 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 16 Sep 2018 18:56:45 -0500 Subject: [PATCH] Fix clampValue issue if min/max are not defined --- manage/config-dialog.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/manage/config-dialog.js b/manage/config-dialog.js index fb4eb153..2e2f0988 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -317,11 +317,13 @@ function configDialog(style) { // Clamp input[type=number] to a valid range function clampValue(value, va) { - if (value < (va.min || 0)) { - return va.min; + const min = va.min || 0; + const max = va.max || 100; + if (value < min) { + return min; } - if (value > (va.max || 100)) { - return va.max; + if (value > max) { + return max; } const inv = 1 / (va.step || 1); // Don't restrict to integer values if step is undefined.