2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

fhemweb.js: fix slider code for extracting number from reading-value

git-svn-id: https://svn.fhem.de/fhem/trunk@22260 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-06-25 08:15:36 +00:00
parent f9cffed213
commit da88821e6e

View File

@ -1692,7 +1692,7 @@ FW_createSlider(elName, devName, vArr, currVal, set, params, cmd)
sh.ontouchstart = function(e) { touchFn(e, mouseDown); }
newEl.setValueFn = function(arg) {
var res = arg.match(/[\d.\-]+/); // extract first number
var res = arg.match(/-?[\d.]+/); // extract first number
currVal = (res ? parseFloat(res[0]) : min);
if(currVal < min || currVal > max)
currVal = min;