return value as default

This commit is contained in:
2017-10-23 22:59:52 +02:00
parent 997d4742d1
commit b8aef19542
3 changed files with 12 additions and 8 deletions

View File

@@ -105,7 +105,12 @@ var $ = function(selector){
}; };
Sui.select(actuator.selector).forEach( (domEl) =>{ Sui.select(actuator.selector).forEach( (domEl) =>{
let handle = function(event) { let handle = function(event) {
update.call(this, actuator.api, 'GET', actuator.data ? actuator.data.call(this) : undefined ); update.call(this,
actuator.api,
'GET',
actuator.data ?
actuator.data.call(this) : [this.value]
);
} }
$(domEl).on(actuator.event, handle) $(domEl).on(actuator.event, handle)
}); });
@@ -173,9 +178,6 @@ var $ = function(selector){
method: 'GET', method: 'GET',
selector: '.laser.slider', selector: '.laser.slider',
event: 'change', event: 'change',
data: function(){
return [this.value];
},
onResponse: debugResponse onResponse: debugResponse
}].forEach(Sui.link({ }].forEach(Sui.link({
api: { api: {

View File

@@ -18,7 +18,12 @@ var Sui = {
}; };
Sui.select(actuator.selector).forEach( (domEl) =>{ Sui.select(actuator.selector).forEach( (domEl) =>{
let handle = function(event) { let handle = function(event) {
update.call(this, actuator.api, 'GET', actuator.data ? actuator.data.call(this) : undefined ); update.call(this,
actuator.api,
'GET',
actuator.data ?
actuator.data.call(this) : [this.value]
);
} }
$(domEl).on(actuator.event, handle) $(domEl).on(actuator.event, handle)
}); });

View File

@@ -16,9 +16,6 @@ Sui.ready(() => {
method: 'GET', method: 'GET',
selector: '.laser.slider', selector: '.laser.slider',
event: 'change', event: 'change',
data: function(){
return [this.value];
},
onResponse: debugResponse onResponse: debugResponse
}].forEach(Sui.link({ }].forEach(Sui.link({
api: { api: {