diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-07-28 09:24:40 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-07-29 14:36:03 +0200 |
| commit | ecc4e512cd3abfae72486f448cd5691de3cb491c (patch) | |
| tree | 112ce97bd0718f328b287661a03be92ce5f8b988 /addons/web/static/src/js/action_manager.js | |
| parent | 970b54d1eba368e2f58a8f3fda0f6a6f6befe9f2 (diff) | |
[IMP] web: action manager: restore action
When clicking on the breadcrumb to come back to a previously loaded action, the
restore() function is called. With this rev, this old action is shown only once
the Deferred returned by the optional on_reverse_breadcrumb callback is
resolved, i.e. when the action is ready, as it should be.
Diffstat (limited to 'addons/web/static/src/js/action_manager.js')
| -rw-r--r-- | addons/web/static/src/js/action_manager.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 7d9f84a24f8..4a3f31b27f3 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -118,8 +118,10 @@ var WidgetAction = Action.extend({ * Restores WidgetAction by calling do_show on its widget */ restore: function() { - this.widget.do_show(); - return this._super(); + var self = this; + return $.when(this._super()).then(function() { + return self.widget.do_show(); + }); }, /** * Destroys the widget @@ -147,10 +149,9 @@ var ViewManagerAction = WidgetAction.extend({ * @param {int} [view_index] the index of the view to select */ restore: function(view_index) { - var self = this; - var _super = this._super; + var _super = this._super.bind(this); return this.widget.select_view(view_index).then(function() { - _super.call(self); + return _super(); }); }, /** |
