summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-06-29 14:47:49 +0000
committerroot <root@beaglebone.local.sublab.org>2013-06-29 14:47:49 +0000
commit4228436293eb143398034257d18e2b1a8cd1aa51 (patch)
tree9c75f6f4fa004d7ce6b9c641e35b0dd079bd96a3
parentd5e30c5ac7291775942d5a3cb645cae18d5ddb06 (diff)
svg: fix some javascript bugs
-rw-r--r--svg/subcan.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/svg/subcan.js b/svg/subcan.js
index 7f2e6cd..8008196 100644
--- a/svg/subcan.js
+++ b/svg/subcan.js
@@ -49,7 +49,7 @@ function on_evt_click(node) {
r = result['result']
console.log('light_get', r);
var set;
- if (r['r'] !== null) {
+ if (r['r']) {
set = (r['r'] + r['g'] + r['b']) / 3;
} else {
set = r['set'];
@@ -113,7 +113,7 @@ function on_evt_mousedown(node, evt) {
},
success: function(result) {
r = result['result']
- if (r['r'] !== null) {
+ if (r['r']) {
mouseorig = (r['r'] + r['g'] + r['b']) / 3;
} else {
mouseorig = r['set'];
@@ -149,11 +149,11 @@ function on_evt_mousemove(node, evt) {
if (offs < 0) {
var pos = (-offs - deadzone) / dimzone;
- console.log("cvo", offs, "+dim", pos);
+ // console.log("cvo", offs, "+dim", pos);
mouseset = mouseorig + pos * (255 - mouseorig);
} else {
var pos = (offs - deadzone) / dimzone;
- console.log("cvo", offs, "-dim", pos);
+ // console.log("cvo", offs, "-dim", pos);
mouseset = mouseorig * (1.0 - pos);
}
mouseset = Math.floor(mouseset);