mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Support {{unless}}
in virtual dom templates
This commit is contained in:
@@ -140,9 +140,13 @@ class Compiler {
|
||||
}
|
||||
break;
|
||||
case "BlockStatement":
|
||||
let negate = '';
|
||||
|
||||
switch(node.path.original) {
|
||||
case 'unless':
|
||||
negate = '!';
|
||||
case 'if':
|
||||
instructions.push(`if (${node.params[0].original}) {`);
|
||||
instructions.push(`if (${negate}${node.params[0].original}) {`);
|
||||
node.program.body.forEach(child => {
|
||||
instructions = instructions.concat(this.processNode(parentAcc, child));
|
||||
});
|
||||
|
Reference in New Issue
Block a user