diff --git a/js/usercss.js b/js/usercss.js index efc0933b..9b126f16 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -217,6 +217,7 @@ var usercss = (() => { break; } + case 'number': case 'range': { state.errorPrefix = 'Invalid JSON: '; parseJSONValue(state); diff --git a/manage/config-dialog.css b/manage/config-dialog.css index 8bf15177..97b8a0bf 100644 --- a/manage/config-dialog.css +++ b/manage/config-dialog.css @@ -104,7 +104,7 @@ margin-right: 4px; } -.config-range span { +.config-number span, .config-range span { line-height: 22px; } diff --git a/manage/config-dialog.js b/manage/config-dialog.js index a2d96007..46bf7f0e 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -267,7 +267,8 @@ function configDialog(style) { onfocus: selectAllOnFocus, }; const dataset = {}; - if (va.type === 'range') { + if (va.type === 'range' || va.type === 'number') { + children = va.type === 'range' ? [$create('span.current-value', {textContent: va.value})] : []; options.value = va.default; if (typeof va.range[0] !== 'undefined') { options.min = dataset.min = va.range[0]; @@ -278,12 +279,11 @@ function configDialog(style) { if (va.range[2]) { options.step = va.range[2]; } - children = [ - $create('span.current-value', {textContent: va.value}), + children.push( $create('span.current-range', {dataset}, [ va.input = $create('input.config-value', options), ]) - ]; + ); } else { children = [ va.input = $create('input.config-value', options),