From 80c1d1e3552d28dfac3b47d3808071e34355d50d Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 10 Feb 2017 15:59:00 +0100 Subject: [PATCH] [FIX] website_forum: wait templates are loaded before binding events This is required since a4dc9a80327be61027924372ae558dc71e892e63 --- addons/website_forum/static/src/js/website_forum.share.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_forum/static/src/js/website_forum.share.js b/addons/website_forum/static/src/js/website_forum.share.js index 60173903a45..5033a0ea624 100644 --- a/addons/website_forum/static/src/js/website_forum.share.js +++ b/addons/website_forum/static/src/js/website_forum.share.js @@ -7,7 +7,7 @@ var base = require('web_editor.base'); var SocialShare = require('website.share'); var website = require('website.website'); var qweb = core.qweb; -ajax.loadXML('/website_forum/static/src/xml/website_forum_share_templates.xml', qweb); +var tmpl = ajax.loadXML('/website_forum/static/src/xml/website_forum_share_templates.xml', qweb); if(!$('.website_forum').length) { @@ -44,7 +44,7 @@ var ForumShare = SocialShare.extend({ } }); -base.ready().done(function() { +$.when(base.ready(), tmpl).done(function() { // Store social share data to display modal on next page $(document.body).on('click', ':not(.karma_required).oe_social_share_call', function() {