From 599602bb76b31e3d7e564eb825e8f0ef48bb649a Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 2 Sep 2013 19:36:29 +0200 Subject: [PATCH] [FIX] potential bug in application initialization bzr revid: nicolas.vanhoren@openerp.com-20130902173629-be1r67o5vtbgb9yp --- addons/web/static/src/js/chrome.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 82cdf46bba8..55ab5ec073d 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1307,13 +1307,8 @@ instance.web.WebClient = instance.web.Client.extend({ this.on("change:title_part", this, this._title_changed); this._title_changed(); return $.when(this._super()).then(function() { - if (jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined) { - $("body").addClass("kitten-mode-activated"); - $("body").css("background-image", "url(" + instance.session.origin + "/web/static/src/img/back-enable.jpg" + ")"); - if ($.blockUI) { - var imgkit = Math.floor(Math.random() * 2 + 1); - $.blockUI.defaults.message = ''; - } + if (jQuery.deparam !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined) { + self.to_kitten(); } if (!self.session.session_is_valid()) { self.show_login(); @@ -1322,6 +1317,15 @@ instance.web.WebClient = instance.web.Client.extend({ } }); }, + to_kitten: function() { + this.kitten = true; + $("body").addClass("kitten-mode-activated"); + $("body").css("background-image", "url(" + instance.session.origin + "/web/static/src/img/back-enable.jpg" + ")"); + if ($.blockUI) { + var imgkit = Math.floor(Math.random() * 2 + 1); + $.blockUI.defaults.message = ''; + } + }, /** Sets the first part of the title of the window, dedicated to the current action. */