diff --git a/js/iD/styleparser/Rule.js b/js/iD/styleparser/Rule.js index f09e2cbb6..6cf8f7b25 100755 --- a/js/iD/styleparser/Rule.js +++ b/js/iD/styleparser/Rule.js @@ -29,9 +29,11 @@ declare("iD.styleparser.Rule", null, { test:function(entity,tags,zoom) { // summary: Evaluate the Rule on the given entity, tags and zoom level. // returns: true if the Rule passes, false if the conditions aren't fulfilled. - if (this.subject !== '' && !entity.entity.isType(this.subject)) { return false; } + if ((this.subject !== '') && (entity.entityType !== this.subject)) { + return false; + } if (zoomthis.maxZoom) { return false; } - + var v=true; var i=0; var isAnd=this.isAnd; array.forEach(this.conditions, function(condition) { var r=condition.test(tags); diff --git a/js/iD/styleparser/RuleChain.js b/js/iD/styleparser/RuleChain.js index 8e21a7d01..19a070364 100755 --- a/js/iD/styleparser/RuleChain.js +++ b/js/iD/styleparser/RuleChain.js @@ -62,20 +62,20 @@ declare("iD.styleparser.RuleChain", null, { test:function(pos, entity, tags, zoom) { // summary: Test a rule chain by running all the tests in reverse order. - if (this.rules.length==0) { return false; } + if (this.rules.length === 0) { return false; } if (pos==-1) { pos=this.rules.length-1; } - - var r=this.rules[pos]; + + var r = this.rules[pos]; if (!r.test(entity, tags, zoom)) { return false; } - if (pos==0) { return true; } - + if (pos === 0) { return true; } + var o = entity.entity.parentObjects(); - for (var i=0; i