diff --git a/nodes/core/logic/10-switch.html b/nodes/core/logic/10-switch.html
index e64aadfa7..bc59f7c94 100644
--- a/nodes/core/logic/10-switch.html
+++ b/nodes/core/logic/10-switch.html
@@ -29,34 +29,41 @@
Add
-
+
+
+
diff --git a/nodes/core/logic/10-switch.js b/nodes/core/logic/10-switch.js
index 5d312518f..c4c8d23b6 100644
--- a/nodes/core/logic/10-switch.js
+++ b/nodes/core/logic/10-switch.js
@@ -14,51 +14,52 @@
* limitations under the License.
**/
-var RED = require(process.env.NODE_RED_HOME+"/red/red");
+var RED = require(process.env.NODE_RED_HOME + "/red/red");
var operators = {
- 'eq':function(a,b) { return a == b; },
- 'neq':function(a,b) { return a != b; },
- 'lt':function(a,b) { return a < b; },
- 'lte':function(a,b) { return a <= b; },
- 'gt':function(a,b) { return a > b; },
- 'gte':function(a,b) { return a >= b; },
- 'btwn':function(a,b,c) { return a >= b && a <= c; },
- 'cont':function(a,b) { return (a+"").indexOf(b) != -1; },
- 'regex': function(a,b) { return (a+"").match(new RegExp(b)); },
+ 'eq': function(a, b) { return a == b; },
+ 'neq': function(a, b) { return a != b; },
+ 'lt': function(a, b) { return a < b; },
+ 'lte': function(a, b) { return a <= b; },
+ 'gt': function(a, b) { return a > b; },
+ 'gte': function(a, b) { return a >= b; },
+ 'btwn': function(a, b, c) { return a >= b && a <= c; },
+ 'cont': function(a, b) { return (a + "").indexOf(b) != -1; },
+ 'regex': function(a, b) { return (a + "").match(new RegExp(b)); },
'true': function(a) { return a === true; },
'false': function(a) { return a === false; },
'null': function(a) { return a === null; },
- 'nnull': function(a) { return a !== null; }
+ 'nnull': function(a) { return a !== null; },
+ 'else': function(a) { return a === true; }
};
-
function SwitchNode(n) {
- RED.nodes.createNode(this,n);
-
- this.rules = n.rules;
- this.property = n.property;
-
- var propertyParts = n.property.split(".");
-
- var node = this;
-
- this.on('input',function(msg) {
- var onward = [];
- var prop = propertyParts.reduce(function(obj,i) {
- return obj[i]
- },msg);
- for (var i=0;i