diff options
| author | Martin Geubelle <mge@odoo.com> | 2016-08-24 15:16:45 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2016-09-28 16:55:51 +0200 |
| commit | b2aafa23b822e99b4c252cd6a3af0e4e1c246ba5 (patch) | |
| tree | 3f413906fa9cfdb1695c66c33648ab58656932cc /addons/web/static/src/js/action_manager.js | |
| parent | 037b7063e27164adf9ff680c34f8f9baa3baaf65 (diff) | |
[IMP] web: trigger event when changing action
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.
Diffstat (limited to 'addons/web/static/src/js/action_manager.js')
| -rw-r--r-- | addons/web/static/src/js/action_manager.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 4a03fadc543..0206e4cd25e 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -326,6 +326,7 @@ var ActionManager = Widget.extend({ self.clear_action_stack(actions_to_destroy); } self.toggle_fullscreen(); + self.trigger_up('current_action_updated', {action: new_action}); }).fail(function () { // Destroy failed action and restore internal state new_action.destroy(); @@ -408,6 +409,7 @@ var ActionManager = Widget.extend({ callbacks: [{widget: action.widget}], }); } + self.trigger_up('current_action_updated', {action: action}); }); }).fail(function() { return $.Deferred().reject(); |
