From b2aafa23b822e99b4c252cd6a3af0e4e1c246ba5 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Wed, 24 Aug 2016 15:16:45 +0200 Subject: [IMP] web: trigger event when changing action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This comportement was added in the DebugManager to trigger an event. As this event could be useful in other situations (e.g. studio), we trigger the event directly in the ActionManager. By default, the WebClient does not use this event but an handler is added to be overwritten. This handler is overwritten in some widgets (DebugManager, Studio, etc.) that requires the Systray items instances so we add them in ´widgets´ in the Systray Menu. As the module dashboard uses multiple ActionManager, the event bubbling should be avoided in this case. --- addons/web/static/src/js/abstract_web_client.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'addons/web/static/src/js/abstract_web_client.js') diff --git a/addons/web/static/src/js/abstract_web_client.js b/addons/web/static/src/js/abstract_web_client.js index c3985f4cf5c..e6dab38f61c 100644 --- a/addons/web/static/src/js/abstract_web_client.js +++ b/addons/web/static/src/js/abstract_web_client.js @@ -30,6 +30,9 @@ var WebClient = Widget.extend({ toggle_fullscreen: function (event) { this.toggle_fullscreen(event.data.fullscreen); }, + current_action_updated: function (e) { + this.current_action_updated(e.data.action); + }, }, init: function(parent) { this.client_options = {}; @@ -220,6 +223,9 @@ var WebClient = Widget.extend({ this.connection_notification = false; } }, + // Handler to be overwritten + current_action_updated: function () { + }, // -------------------------------------------------------------- // Scrolltop handling // -------------------------------------------------------------- -- cgit v1.2.3