2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

fhemweb.js: fix slider in dashboard (Forum #16503)

git-svn-id: https://svn.fhem.de/fhem/trunk@9879 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-11-13 08:16:46 +00:00
parent fa8209b443
commit 916148c8d4

View File

@ -827,11 +827,14 @@ FW_createSlider(elName, devName, vArr, currVal, set, params, cmd)
var oldFn1 = document.onmousemove, oldFn2 = document.onmouseup, var oldFn1 = document.onmousemove, oldFn2 = document.onmouseup,
oldFn3 = document.ontouchmove, oldFn4 = document.ontouchend; oldFn3 = document.ontouchmove, oldFn4 = document.ontouchend;
e.stopPropagation(); // Dashboard fix
lastX = e.clientX; // Does not work on IE8 lastX = e.clientX; // Does not work on IE8
function function
mouseMove(e) mouseMove(e)
{ {
e.stopPropagation(); // Dashboard fix
if(maxX == 0) // Forum #35846 if(maxX == 0) // Forum #35846
maxX = slider.offsetWidth-sh.offsetWidth; maxX = slider.offsetWidth-sh.offsetWidth;
var diff = e.clientX-lastX; lastX = e.clientX; var diff = e.clientX-lastX; lastX = e.clientX;
@ -849,6 +852,7 @@ FW_createSlider(elName, devName, vArr, currVal, set, params, cmd)
document.onmouseup = document.ontouchend = function(e) document.onmouseup = document.ontouchend = function(e)
{ {
e.stopPropagation(); // Dashboard fix
document.onmousemove = oldFn1; document.onmouseup = oldFn2; document.onmousemove = oldFn1; document.onmouseup = oldFn2;
document.ontouchmove = oldFn3; document.ontouchend = oldFn4; document.ontouchmove = oldFn3; document.ontouchend = oldFn4;
if(cmd) if(cmd)