diff options
Diffstat (limited to 'web/share/js')
-rw-r--r-- | web/share/js/kvm/gpio.js | 8 |
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; |