[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:
parent
82ba784f0d
commit
82ef798ef2
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue