mirror of
https://github.com/0x1d/esp8266-laser.git
synced 2025-12-16 10:44:30 +01:00
oidshfs
This commit is contained in:
@@ -9,22 +9,18 @@ var Sui = {
|
||||
},
|
||||
link: (node) => {
|
||||
return (actuator) => {
|
||||
let update = function(endpoint, method, props) {
|
||||
let update = actuator.handler || function(actuator) {
|
||||
Sui.http.ajax({
|
||||
method: method,
|
||||
endpoint: node.api[endpoint],
|
||||
data: props,
|
||||
method: actuator.method,
|
||||
endpoint: actuator.api,
|
||||
data: actuator.data ?
|
||||
actuator.data.call(this) : [this.value],
|
||||
cache: false
|
||||
}, actuator.onResponse || null);
|
||||
};
|
||||
Sui.select(actuator.selector).forEach( (domEl) =>{
|
||||
let handle = function(event) {
|
||||
update.call(this,
|
||||
actuator.api,
|
||||
actuator.method,
|
||||
actuator.data ?
|
||||
actuator.data.call(this) : [this.value]
|
||||
);
|
||||
update.call(this, actuator);
|
||||
}
|
||||
domEl.addEventListener(actuator.event, handle)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user