1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-07 22:29:19 +00:00

FHEMWEB slider: avoid strange setting when just clicking on the slider

git-svn-id: https://svn.fhem.de/fhem/trunk@4262 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-11-22 13:24:09 +00:00
parent f03673ada2
commit df4b76a7ee

View File

@ -1,4 +1,5 @@
/*************** SLIDER **************/ /*************** SLIDER **************/
function function
FW_sliderUpdateLine(d) FW_sliderUpdateLine(d)
{ {
@ -31,7 +32,7 @@ function
FW_sliderCreate(slider, curr) FW_sliderCreate(slider, curr)
{ {
var sh = slider.firstChild; var sh = slider.firstChild;
var lastX=-1, offX=0, maxX=0, val=-1; var lastX=-1, offX=0, maxX=0, val;
var min = parseFloat(slider.getAttribute("min")); var min = parseFloat(slider.getAttribute("min"));
var stp = parseFloat(slider.getAttribute("stp")); var stp = parseFloat(slider.getAttribute("stp"));
var max = parseFloat(slider.getAttribute("max")); var max = parseFloat(slider.getAttribute("max"));
@ -93,10 +94,12 @@ FW_sliderCreate(slider, curr)
document.ontouchmove = oldFn3; document.ontouchend = oldFn4; document.ontouchmove = oldFn3; document.ontouchend = oldFn4;
if(cmd) { if(cmd) {
if(cmd.substring(0,3) != "js:") { if(cmd.substring(0,3) != "js:") {
document.location = cmd.replace('%',val); if(typeof val != "undefined")
document.location = cmd.replace('%',val);
} }
} else { } else {
slider.nextSibling.setAttribute('value', val); if(typeof val != "undefined")
slider.nextSibling.setAttribute('value', val);
} }
}; };
}; };