Switch to isNumber function

This commit is contained in:
Rob Garrison 2018-09-18 07:29:35 -05:00
parent 314ec99e5c
commit 375e0ec448

View File

@ -197,12 +197,12 @@ function configDialog(style) {
renderValues(); renderValues();
} }
function isNullOrUndefined(value) { function isNumber(value) {
return value === null || value === undefined; return value !== '' && !isNaN(Number(value));
} }
function isDefault(va) { function isDefault(va) {
return isNullOrUndefined(va.value) || va.value === va.default; return va.value === null || va.value === undefined || va.value === va.default;
} }
function buildConfigForm() { function buildConfigForm() {
@ -271,13 +271,13 @@ function configDialog(style) {
onchange: updateVarOnChange, onchange: updateVarOnChange,
oninput: updateVarOnInput oninput: updateVarOnInput
}; };
if (!isNullOrUndefined(va.min)) { if (isNumber(va.min)) {
options.min = va.min; options.min = va.min;
} }
if (!isNullOrUndefined(va.max)) { if (isNumber(va.max)) {
options.max = va.max; options.max = va.max;
} }
if (!isNullOrUndefined(va.step)) { if (isNumber(va.step) && isFinite(Number(va.step))) {
options.step = va.step; options.step = va.step;
} }
children = [ children = [