comparison web/views/set.tpl @ 302:ef407d48cbe5

add step attribute for numbers
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 Jul 2019 22:44:12 +0800
parents f7261dd970da
children
comparison
equal deleted inserted replaced
301:47c259458160 302:ef407d48cbe5
98 <script type="html/num_input"> 98 <script type="html/num_input">
99 <div id="{id}"> 99 <div id="{id}">
100 <span class="existing">{title} <span id="oldvalue">{oldvaluetext}{unit}</span></span> 100 <span class="existing">{title} <span id="oldvalue">{oldvaluetext}{unit}</span></span>
101 <br/> 101 <br/>
102 <span class="inputrow"> 102 <span class="inputrow">
103 <input type="number" class="input" name="input_{name}" /> 103 <input type="number" class="input" name="input_{name}" step="{numberstep}"/>
104 <input type="button" class="button_down" value="-"/> 104 <input type="button" class="button_down" value="-"/>
105 <input type="button" class="button_up" value="+"/> 105 <input type="button" class="button_up" value="+"/>
106 </span> 106 </span>
107 </div> 107 </div>
108 </script> 108 </script>
134 param.oldvaluetext = param.oldvalue ? "Yes" : "No"; 134 param.oldvaluetext = param.oldvalue ? "Yes" : "No";
135 } 135 }
136 else if (param.kind == "number") 136 else if (param.kind == "number")
137 { 137 {
138 param.oldvaluetext = Number(param.oldvalue).toFixed(param.digits) 138 param.oldvaluetext = Number(param.oldvalue).toFixed(param.digits)
139 param.numberstep = 0.1**param.digits
139 } 140 }
140 else 141 else
141 { 142 {
142 param.oldvaluetext = param.oldvalue; 143 param.oldvaluetext = param.oldvalue;
143 } 144 }