Index: chrome/content/ui/filters.js |
=================================================================== |
--- a/chrome/content/ui/filters.js |
+++ b/chrome/content/ui/filters.js |
@@ -131,17 +131,22 @@ var Templater = |
{ |
if (node.localName == "if") |
conditionals.push(node); |
for (let i = 0; i < node.attributes.length; i++) |
{ |
let attribute = node.attributes[i]; |
let len = attribute.value.length; |
if (len >= 2 && attribute.value[0] == "{" && attribute.value[len - 1] == "}") |
- attribute.value = Cu.evalInSandbox(attribute.value.substr(1, len - 2), sandbox); |
+ { |
+ let value = Cu.evalInSandbox(attribute.value.substr(1, len - 2), sandbox); |
+ if (attribute.name == "condition") |
+ value = value ? "true" : "false"; |
+ attribute.value = value; |
+ } |
} |
} |
// Process <if> tags - remove if condition is false, replace by their children |
// if it is true |
for each (let node in conditionals) |
{ |
let fragment = document.createDocumentFragment(); |