From b8aef1954233aad4a5a5b72691eb147f1d866e2a Mon Sep 17 00:00:00 2001 From: Patrick Balsiger Date: Mon, 23 Oct 2017 22:59:52 +0200 Subject: [PATCH] return value as default --- data/scripts.js | 10 ++++++---- frontend/scripts/sui.js | 7 ++++++- frontend/scripts/zMain.js | 3 --- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/data/scripts.js b/data/scripts.js index de56c29..4554c40 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -105,7 +105,12 @@ var $ = function(selector){ }; Sui.select(actuator.selector).forEach( (domEl) =>{ 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) }); @@ -173,9 +178,6 @@ var $ = function(selector){ method: 'GET', selector: '.laser.slider', event: 'change', - data: function(){ - return [this.value]; - }, onResponse: debugResponse }].forEach(Sui.link({ api: { diff --git a/frontend/scripts/sui.js b/frontend/scripts/sui.js index f1b4f27..363e974 100644 --- a/frontend/scripts/sui.js +++ b/frontend/scripts/sui.js @@ -18,7 +18,12 @@ var Sui = { }; Sui.select(actuator.selector).forEach( (domEl) =>{ 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) }); diff --git a/frontend/scripts/zMain.js b/frontend/scripts/zMain.js index 9b26482..9603fea 100644 --- a/frontend/scripts/zMain.js +++ b/frontend/scripts/zMain.js @@ -16,9 +16,6 @@ Sui.ready(() => { method: 'GET', selector: '.laser.slider', event: 'change', - data: function(){ - return [this.value]; - }, onResponse: debugResponse }].forEach(Sui.link({ api: {