diff options
Diffstat (limited to 'addons/web/static/src/js/view_manager.js')
| -rw-r--r-- | addons/web/static/src/js/view_manager.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/web/static/src/js/view_manager.js b/addons/web/static/src/js/view_manager.js index f2c216ebd83..c5db4b954ca 100644 --- a/addons/web/static/src/js/view_manager.js +++ b/addons/web/static/src/js/view_manager.js @@ -141,12 +141,6 @@ var ViewManager = Widget.extend(ControlPanelMixin, { this.view_stack.pop(); } this.view_stack.push(view); - - // Hide active view (at first rendering, there is no view to hide) - if (this.active_view && this.active_view !== view) { - if (this.active_view.controller) this.active_view.controller.do_hide(); - if (this.active_view.$container) this.active_view.$container.hide(); - } this.active_view = view; if (!view.created) { @@ -188,10 +182,16 @@ var ViewManager = Widget.extend(ControlPanelMixin, { }; self.update_control_panel(cp_status); - // Detach the old view but not ui-autocomplete elements to let - // jquery-ui garbage-collect them if (old_view) { + // Detach the old view but not ui-autocomplete elements to let + // jquery-ui garbage-collect them old_view.$container.contents().not('.ui-autocomplete').detach(); + + // Hide old view (at first rendering, there is no view to hide) + if (self.active_view !== old_view) { + if (old_view.controller) old_view.controller.do_hide(); + if (old_view.$container) old_view.$container.hide(); + } } // Append the view fragment to its $container |
