From 020c0927e43b55f897fb4a990db4db051c8a55d3 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 13 Dec 2011 16:35:50 +0100 Subject: [PATCH] [IMP] chrome small cleanups bzr revid: al@openerp.com-20111213153550-x1dd1nrzmaoen61n --- addons/web/static/src/js/chrome.js | 22 +++++++------------ .../web_dashboard/static/src/js/dashboard.js | 3 ++- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index a70aa50c6e2..87b19b98950 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1057,7 +1057,13 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie }) } }, - + on_logged_out: function() { + $(window).unbind('hashchange', this.on_hashchange); + this.do_push_state({},true); + if(this.action_manager) + this.action_manager.stop(); + this.action_manager = null; + }, bind_hashchange: function() { $(window).bind('hashchange', this.on_hashchange); @@ -1068,15 +1074,6 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie this.action_manager.do_action({type: 'ir.actions.client', tag: 'default_home'}); } }, - - on_logged_out: function() { - $(window).unbind('hashchange', this.on_hashchange); - this.do_push_state({},true); - if(this.action_manager) - this.action_manager.stop(); - this.action_manager = null; - }, - on_hashchange: function(event) { var state = event.getState(true); if (!_.isEqual(this._current_state, state)) { @@ -1084,7 +1081,6 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie } this._current_state = state; }, - do_push_state: function(state, overwrite) { if (!overwrite) { var hash = $.deparam.fragment(true); @@ -1094,20 +1090,18 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie this._current_state = _.clone(state); $.bbq.pushState(url); }, - on_menu_action: function(action) { this.action_manager.do_action(action); }, do_action: function(action) { var self = this; + // TODO replace by client action menuclick if(action.type === "ir.ui.menu") { this.do_reload().then(function () { self.menu.on_menu_click(null, action.menu_id); }); } }, - do_about: function() { - } }); }; diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index fc2bb31ddb8..c7132d7a9ef 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -397,6 +397,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({ this._super(parent); }, start: function() { + // TODO menu hide var self = this; var domain = [['application','=',true], ['state','=','installed'], ['name', '!=', 'base']]; var ds = new openerp.web.DataSetSearch(this, 'ir.module.module',{},domain); @@ -438,8 +439,8 @@ openerp.web.client_actions.add( 'board.application.installer', 'openerp.web_dash openerp.web_dashboard.ApplicationInstaller = openerp.web.Widget.extend({ template: 'web_dashboard.ApplicationInstaller', start: function () { + // TODO menu hide var r = this._super(); - //$('.secondary_menu', this.$element.closest('.openerp')).hide(); this.action_manager = new openerp.web.ActionManager(this); this.action_manager.appendTo(this.$element.find('.oe_installer')); this.action_manager.do_action({