From cb16d209093188d7a25133974640f8075fe7fbb0 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 19 Nov 2015 14:21:25 +0100 Subject: [PATCH] [FIX] website: theme customization modal crash When clicking on customize theme button or going on an url which contains the theme=true option, the theme customization modal failed to be launched as we did not wait for website to be ready. --- addons/website/static/src/js/website.theme.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/website/static/src/js/website.theme.js b/addons/website/static/src/js/website.theme.js index 394c8afe843..b392f27dc5b 100644 --- a/addons/website/static/src/js/website.theme.js +++ b/addons/website/static/src/js/website.theme.js @@ -301,11 +301,15 @@ function theme_customize() { website.TopBar.include({ start: function () { - this.$el.on('click', "#theme_customize a", theme_customize); - if ((window.location.hash || "").indexOf("theme=true") !== -1) { - theme_customize(); - window.location.hash = ""; - } + var self = this; + base.ready().then(function () { + self.$el.on('click', "#theme_customize a", theme_customize); + if ((window.location.hash || "").indexOf("theme=true") !== -1) { + theme_customize(); + window.location.hash = ""; + } + }); + return this._super(); } });