From 6f57449dcd48714ff9df5ff37dfbc0882610020e Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 5 Nov 2012 14:00:53 +0100 Subject: [IMP] Client actions now takes the action as argument. Use action.params for options. bzr revid: fme@openerp.com-20121105130053-6gdklt6ok4lst6ba --- addons/web/static/src/js/chrome.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'addons/web/static/src/js/chrome.js') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 6cf35a14e92..08ef8c4f9bf 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -504,13 +504,13 @@ instance.web.Login = instance.web.Widget.extend({ template: "Login", remember_credentials: true, - init: function(parent, params) { + init: function(parent, action) { this._super(parent); this.has_local_storage = typeof(localStorage) != 'undefined'; this.db_list = null; this.selected_db = null; this.selected_login = null; - this.params = params || {}; + this.params = action.params || {}; if (this.params.login_successful) { this.on('login_successful', this, this.params.login_successful); @@ -616,8 +616,9 @@ instance.web.client_actions.add("login", "instance.web.Login"); * Client action to reload the whole interface. * If params has an entry 'menu_id', it opens the given menu entry. */ -instance.web.Reload = function(parent, params) { - var menu_id = (params && params.menu_id) || false; +instance.web.Reload = function(parent, action) { + var params = action.params || {}; + var menu_id = params.menu_id || false; var l = window.location; var sobj = $.deparam(l.search.substr(1)); @@ -638,7 +639,7 @@ instance.web.client_actions.add("reload", "instance.web.Reload"); * Client action to go back in breadcrumb history. * If can't go back in history stack, will go back to home. */ -instance.web.HistoryBack = function(parent, params) { +instance.web.HistoryBack = function(parent) { if (!parent.history_back()) { window.location = '/' + (window.location.search || ''); } @@ -649,7 +650,7 @@ instance.web.client_actions.add("history_back", "instance.web.HistoryBack"); * Client action to go back home. */ instance.web.Home = instance.web.Widget.extend({ - init: function(parent, params) { + init: function(parent) { window.location = '/' + (window.location.search || ''); } }); -- cgit v1.2.3