From 4228436293eb143398034257d18e2b1a8cd1aa51 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sat, 29 Jun 2013 14:47:49 +0000 Subject: svg: fix some javascript bugs --- svg/subcan.js | 8 ++++---- 1 file 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); -- cgit v1.2.1