From 3de69dc5c5329b2807ed6159a624cdd033df8e67 Mon Sep 17 00:00:00 2001 From: James Tarling Date: Mon, 16 Nov 2015 11:44:29 +0000 Subject: [PATCH] #30. tweaking display table. bug fix. optimisation --- app/css/wedo.css | 6 +++--- .../devices/wedo/blockly/generators/javascript/input.js | 2 +- app/js/devices/wedo/wedo-ui.js | 8 ++++---- src/sass/wedo.scss | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/css/wedo.css b/app/css/wedo.css index 6eb1616..e5bd33e 100644 --- a/app/css/wedo.css +++ b/app/css/wedo.css @@ -6,15 +6,15 @@ #pane-wedo .table-wrapper .table col:nth-of-type(1) { width: 10%; } #pane-wedo .table-wrapper .table col:nth-of-type(2) { - width: 70%; } + width: 50%; } #pane-wedo .table-wrapper .table col:nth-of-type(3) { - width: 20%; } + width: 40%; } #pane-wedo .table-wrapper .table th { text-align: center; } #pane-wedo .table-wrapper .table .slot-type { padding-left: 20px !important; } #pane-wedo .table-wrapper .table .slot-value { - text-align: center; } + text-align: right; } #pane-wedo .req { display: none; } diff --git a/app/js/devices/wedo/blockly/generators/javascript/input.js b/app/js/devices/wedo/blockly/generators/javascript/input.js index e6513b9..24ecdb2 100644 --- a/app/js/devices/wedo/blockly/generators/javascript/input.js +++ b/app/js/devices/wedo/blockly/generators/javascript/input.js @@ -40,7 +40,7 @@ define(["../javascript"],function(generators){ var tilt_value = block.getFieldValue('value'); var statements_trueblock = generators.statementToCode(block, 'trueblock'); var statements_falseblock = generators.statementToCode(block, 'falseblock'); - var code = 'if (' + text_sensor + ' ' + text_value + ') {\n'; + var code = 'if (' + text_sensor + ' ' + tilt_value + ') {\n'; code += statements_trueblock; code += '} else {\n'; code += statements_falseblock; diff --git a/app/js/devices/wedo/wedo-ui.js b/app/js/devices/wedo/wedo-ui.js index f1f4fc8..8eb5812 100644 --- a/app/js/devices/wedo/wedo-ui.js +++ b/app/js/devices/wedo/wedo-ui.js @@ -84,7 +84,8 @@ define([ } var self = {}; - + var TILT_STATES = ["none","down","this way","up","that way"]; + self.updateConnection = function(count) { if (count > 0) { @@ -117,12 +118,11 @@ define([ else value = lang.ui.get("DEVICE_OFF"); } - + if (isTilt(type)) { - var TILT_STATES = ["none","down","this way","up","that way"]; value = TILT_STATES[value]; } - + var s = isSensor(type); type = type.toLowerCase(); if (s) type += " " + lang.ui.get("DEVICE_SENSOR"); diff --git a/src/sass/wedo.scss b/src/sass/wedo.scss index b467471..34ca602 100644 --- a/src/sass/wedo.scss +++ b/src/sass/wedo.scss @@ -12,10 +12,10 @@ width: 10%; } &:nth-of-type(2) { - width: 70%; + width: 50%; } &:nth-of-type(3) { - width: 20%; + width: 40%; } } @@ -26,7 +26,7 @@ padding-left: 20px !important; } .slot-value { - text-align: center; + text-align: right; } } }