2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 16:46:35 +00:00

fhemweb.js: fix rounding if min is not multiple of step (Forum #34230)

git-svn-id: https://svn.fhem.de/fhem/trunk@8076 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-02-23 10:22:19 +00:00
parent 177836cffd
commit 5870337e5e

View File

@ -759,9 +759,9 @@ FW_createSlider(elName, devName, vArr, currVal, set, params, cmd)
offX += diff;
if(offX < 0) offX = 0;
if(offX > maxX) offX = maxX;
val = min+(offX/maxX * (max-min));
val = offX/maxX * (max-min);
val = (flt ? Math.floor(val/stp)*stp :
Math.floor(Math.floor(val/stp)*stp));
Math.floor(Math.floor(val/stp)*stp))+min;
sh.innerHTML = val;
sh.setAttribute('style', 'left:'+offX+'px;');
}