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

Commit

Permalink
BasicUI: adjust rollershutter widget event handlers, fixes #1020
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Ivanov <vlad-mbx@ya.ru>
  • Loading branch information
Vlad Ivanov committed Feb 15, 2016
1 parent 079533e commit 945e983
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 945e983

Please sign in to comment.