[IMP] QWeb: add method has_template, search action handler in Engine instance too

bzr revid: fme@openerp.com-20110901161917-2parwzf526fe3nvl
This commit is contained in:
Fabien Meghazi 2011-09-01 18:19:17 +02:00
parent 82ba784f0d
commit 82ef798ef2
1 changed files with 8 additions and 2 deletions

View File

@ -290,6 +290,9 @@ QWeb2.Engine = (function() {
xDoc.loadXML(s);
return xDoc;
},
has_template : function(template) {
return !!this.templates[template];
},
get_xhr : function() {
if (window.XMLHttpRequest) {
return new window.XMLHttpRequest();
@ -584,10 +587,13 @@ QWeb2.Element = (function() {
if (a in this.actions) {
var value = this.actions[a];
var key = 'compile_action_' + a;
if (!this[key]) {
if (this[key]) {
this[key](value);
} else if (this.engine[key]) {
this.engine[key].call(this, value);
} else {
this.engine.tools.exception("No handler method for action '" + a + "'");
}
this[key](value);
}
}
if (this.tag !== this.engine.prefix) {