Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1044 from resetnow/basicui-rollershutter-touch-ev…
Browse files Browse the repository at this point in the history
…ents

BasicUI: adjust rollershutter widget event handlers, fixes #1020
  • Loading branch information
kaikreuzer committed Feb 15, 2016
2 parents 079533e + 945e983 commit f57b1d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions extensions/ui/org.eclipse.smarthome.ui.basic/web-src/smarthome.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,17 +513,20 @@
}));
}

function onMouseDown(command) {
function onMouseDown(command, event) {
longPress = false;
pressed = true;

timeout = setTimeout(function() {
longPress = true;
emitEvent(command);
}, longpressTimeout);

event.stopPropagation();
event.preventDefault();
}

function onMouseUp(command) {
function onMouseUp(command, event) {
clearTimeout(timeout);
if (!pressed) {
return;
Expand All @@ -535,10 +538,16 @@
} else {
emitEvent(command);
}

event.stopPropagation();
event.preventDefault();
}

function onStop() {
function onStop(event) {
emitEvent("STOP");

event.stopPropagation();
event.preventDefault();
}

var
Expand Down
Loading

0 comments on commit f57b1d7

Please sign in to comment.