summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-10-07 02:27:58 +0300
committerDevaev Maxim <[email protected]>2020-10-07 02:27:58 +0300
commit6ae7adfb33df2bafb810876ba54cc99689e94f03 (patch)
tree8f98be2877bab61077fea35c0735f3ad5d26c192
parentbb68008f70871e200522f194eae8447034ad300a (diff)
fixed closure
-rw-r--r--web/share/js/kvm/gpio.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/share/js/kvm/gpio.js b/web/share/js/kvm/gpio.js
index a67224b7..946e51c1 100644
--- a/web/share/js/kvm/gpio.js
+++ b/web/share/js/kvm/gpio.js
@@ -96,17 +96,21 @@ export function Gpio() {
for (let channel in model.scheme.outputs) {
let el = $(`gpio-switch-${channel}`);
if (el) {
- tools.setOnClick(el, () => __switchChannel(el));
+ tools.setOnClick(el, __createAction(el, __switchChannel));
}
el = $(`gpio-button-${channel}`);
if (el) {
- tools.setOnClick(el, () => __pulseChannel(el));
+ tools.setOnClick(el, __createAction(el, __pulseChannel));
}
}
self.setState(__state);
};
+ var __createAction = function(el, action) {
+ return () => action(el);
+ };
+
var __createItem = function(item) {
if (item.type === "label") {
return item.text;