fix motor numbers and parameter order

This commit is contained in:
2017-10-23 22:55:26 +02:00
parent 6ec06be6c8
commit 997d4742d1
6 changed files with 30 additions and 20 deletions

View File

@@ -12,15 +12,13 @@ var Sui = {
let update = function(endpoint, method, props) {
Sui.http.ajax({
method: method,
endpoint: node.api[endpoint] + props.join('/'),
endpoint: node.api[endpoint] + (props ? props.join('/') : ''),
cache: false
}, actuator.onResponse || null);
};
Sui.select(actuator.selector).forEach( (domEl) =>{
let handle = function(event) {
data = [this.value];
actuator.data ? data.push(actuator.data.call(this)) : undefined;
update.call(this, actuator.api, 'GET', data);
update.call(this, actuator.api, 'GET', actuator.data ? actuator.data.call(this) : undefined );
}
$(domEl).on(actuator.event, handle)
});