changeset 302:ef407d48cbe5

add step attribute for numbers
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 Jul 2019 22:44:12 +0800
parents 47c259458160
children a99631597f65
files web/views/set.tpl
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/web/views/set.tpl	Sat Jul 06 19:17:21 2019 +0800
+++ b/web/views/set.tpl	Tue Jul 23 22:44:12 2019 +0800
@@ -100,7 +100,7 @@
 <span class="existing">{title} <span id="oldvalue">{oldvaluetext}{unit}</span></span>
 <br/>
 <span class="inputrow">
-<input type="number" class="input" name="input_{name}" />
+<input type="number" class="input" name="input_{name}" step="{numberstep}"/>
 <input type="button" class="button_down" value="-"/>
 <input type="button" class="button_up" value="+"/>
 </span>
@@ -136,6 +136,7 @@
         else if (param.kind == "number")
         {
             param.oldvaluetext = Number(param.oldvalue).toFixed(param.digits)
+            param.numberstep = 0.1**param.digits
         }
         else
         {