[FIX] potential bug in application initialization

bzr revid: nicolas.vanhoren@openerp.com-20130902173629-be1r67o5vtbgb9yp
This commit is contained in:
niv-openerp 2013-09-02 19:36:29 +02:00
parent 25333a628d
commit 599602bb76
1 changed files with 11 additions and 7 deletions

View File

@ -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 = '<img src="http://www.amigrave.com/loading-kitten/' + imgkit + '.gif" class="loading-kitten">';
}
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 = '<img src="http://www.amigrave.com/loading-kitten/' + imgkit + '.gif" class="loading-kitten">';
}
},
/**
Sets the first part of the title of the window, dedicated to the current action.
*/