diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-01-05 15:51:49 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-01-05 15:51:49 +0100 |
| commit | 31ce19bd7c8ff90aa3a3f34ba13dfbbe00865b3b (patch) | |
| tree | 4f24c985d7f4f7d08af1830f8199b120f35018f7 /addons/web/static/src/js/view_manager.js | |
| parent | 9b5311e0c94ea2b3ad6c36bc9a4ea63228779b66 (diff) | |
| parent | 97e87a42cdfaed04a6f50d928d86ac6e3bec9f91 (diff) | |
[MERGE] forward port of branch 9.0 up to 97e87a4
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 |
