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

BasicUI: adjust rollershutter widget event handlers, fixes #1020 #1044

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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