From 7be33a9237c0d68bb76902d0b39128b83f5d7e9c Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Mon, 17 Sep 2018 22:22:57 -0500 Subject: [PATCH] Fix default values --- js/usercss.js | 2 +- manage/config-dialog.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/usercss.js b/js/usercss.js index 54d41526..720ac3fb 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -226,7 +226,7 @@ var usercss = (() => { result.default = range[0]; result.min = range[1]; result.max = range[2]; - result.step = range[3] || 1; + result.step = range[3] == 0 ? 1 : range[3]; } break; } diff --git a/manage/config-dialog.js b/manage/config-dialog.js index 2e2f0988..d749fada 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -317,8 +317,8 @@ function configDialog(style) { // Clamp input[type=number] to a valid range function clampValue(value, va) { - const min = va.min || 0; - const max = va.max || 100; + const min = typeof va.min === 'undefined' ? 0 : va.min; + const max = typeof va.max === 'undefined' ? 100 : va.max; if (value < min) { return min; }