[IMP] QWeb2 t-js now handles more than one child

bzr revid: fme@openerp.com-20110622143805-qryluomj7w4l3s5m
This commit is contained in:
Fabien Meghazi 2011-06-22 16:38:05 +02:00
parent 0e6668a391
commit 2cbb2fe36c
1 changed files with 3 additions and 8 deletions

View File

@ -670,15 +670,10 @@ QWeb2.Element = (function() {
this.top("(function(" + value + ") {");
this.bottom("})(dict);");
this.indent();
if (this.children.length === 1) {
var lines = this.children[0].node.data.split(/\r?\n/);
for (var i = 0, ilen = lines.length; i < ilen; i++) {
this.top(lines[i]);
}
} else {
this.engine.tools.exception("'js' code block contains " + this.children.length + " nodes instead of 1");
var lines = this.engine.tools.xml_node_to_string(this.node, true).split(/\r?\n/);
for (var i = 0, ilen = lines.length; i < ilen; i++) {
this.top(lines[i]);
}
// Maybe I could handle the children ?
this.process_children = false;
},
compile_action_debug : function(value) {