[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.
This commit is contained in:
Aaron Bohy
2015-07-29 14:36:03 +02:00
parent 970b54d1eb
commit ecc4e512cd
+6 -5
View File
@@ -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();
});
},
/**