From 375e0ec44827c877a694fcc0ed3f5d7ed300aec6 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Tue, 18 Sep 2018 07:29:35 -0500 Subject: [PATCH] Switch to isNumber function --- manage/config-dialog.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manage/config-dialog.js b/manage/config-dialog.js index 9c9910fd..b7f8f5f9 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -197,12 +197,12 @@ function configDialog(style) { renderValues(); } - function isNullOrUndefined(value) { - return value === null || value === undefined; + function isNumber(value) { + return value !== '' && !isNaN(Number(value)); } function isDefault(va) { - return isNullOrUndefined(va.value) || va.value === va.default; + return va.value === null || va.value === undefined || va.value === va.default; } function buildConfigForm() { @@ -271,13 +271,13 @@ function configDialog(style) { onchange: updateVarOnChange, oninput: updateVarOnInput }; - if (!isNullOrUndefined(va.min)) { + if (isNumber(va.min)) { options.min = va.min; } - if (!isNullOrUndefined(va.max)) { + if (isNumber(va.max)) { options.max = va.max; } - if (!isNullOrUndefined(va.step)) { + if (isNumber(va.step) && isFinite(Number(va.step))) { options.step = va.step; } children = [