[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.
This commit is contained in:
qsm-odoo
2015-11-19 17:14:56 +01:00
parent 068b81cfef
commit cb16d20909
@@ -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();
}
});