mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
fixed closure
This commit is contained in:
parent
bb68008f70
commit
6ae7adfb33
@ -96,17 +96,21 @@ export function Gpio() {
|
|||||||
for (let channel in model.scheme.outputs) {
|
for (let channel in model.scheme.outputs) {
|
||||||
let el = $(`gpio-switch-${channel}`);
|
let el = $(`gpio-switch-${channel}`);
|
||||||
if (el) {
|
if (el) {
|
||||||
tools.setOnClick(el, () => __switchChannel(el));
|
tools.setOnClick(el, __createAction(el, __switchChannel));
|
||||||
}
|
}
|
||||||
el = $(`gpio-button-${channel}`);
|
el = $(`gpio-button-${channel}`);
|
||||||
if (el) {
|
if (el) {
|
||||||
tools.setOnClick(el, () => __pulseChannel(el));
|
tools.setOnClick(el, __createAction(el, __pulseChannel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setState(__state);
|
self.setState(__state);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var __createAction = function(el, action) {
|
||||||
|
return () => action(el);
|
||||||
|
};
|
||||||
|
|
||||||
var __createItem = function(item) {
|
var __createItem = function(item) {
|
||||||
if (item.type === "label") {
|
if (item.type === "label") {
|
||||||
return item.text;
|
return item.text;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user