summaryrefslogtreecommitdiff
path: root/addons/website_form/static/src/js/website_form.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-01-22 17:47:32 +0100
committerChristophe Simonis <chs@odoo.com>2018-01-22 17:47:32 +0100
commitfa1f2132e79f2ac2314a8b417d5d35d6571bd41b (patch)
tree3789a8335dd5089998de3c5c6a391b2d95a85187 /addons/website_form/static/src/js/website_form.js
parentdb27489fe756b24647e993a22340705625839698 (diff)
parent950d9b2369046f2e3199d144df8edbd0e63f8a2f (diff)
[MERGE] forward port branch 11.0 up to 950d9b23690
Diffstat (limited to 'addons/website_form/static/src/js/website_form.js')
-rw-r--r--addons/website_form/static/src/js/website_form.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/website_form/static/src/js/website_form.js b/addons/website_form/static/src/js/website_form.js
index aa540650473..47ba66c244b 100644
--- a/addons/website_form/static/src/js/website_form.js
+++ b/addons/website_form/static/src/js/website_form.js
@@ -22,7 +22,7 @@ odoo.define('website_form.animation', function (require) {
start: function () {
var self = this;
- qweb.add_template('/website_form/static/src/xml/website_form.xml');
+ this.templates_loaded = ajax.loadXML('/website_form/static/src/xml/website_form.xml', qweb);
this.$target.find('.o_website_form_send').on('click',function (e) {self.send(e);});
// Initialize datetimepickers
@@ -233,7 +233,10 @@ odoo.define('website_form.animation', function (require) {
if (status !== 'success') { // Restore send button behavior if result is an error
this.$target.find('.o_website_form_send').on('click',function (e) {self.send(e);});
}
- this.$target.find('#o_website_form_result').replaceWith(qweb.render("website_form.status_" + status));
+ var $result = this.$('#o_website_form_result');
+ this.templates_loaded.done(function () {
+ $result.replaceWith(qweb.render("website_form.status_" + status));
+ });
},
});
});