summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_manager.js
diff options
context:
space:
mode:
authorMohammed Shekha <msh@openerp.com>2015-12-11 13:03:45 +0530
committerNicolas Lempereur <nle@odoo.com>2016-01-05 14:25:57 +0100
commitedf565881c77840dce8b26f25c1a2648d2b13a9b (patch)
tree985436ccdf21e7493a10b77477998a09b66bd772 /addons/web/static/src/js/view_manager.js
parent77aee2d78fb75a3cc55f7a8ff45c867e5a26a78d (diff)
[FIX] web: refresh in form view when first view mode is calendar
When you are in form view and came from calendar, a screen refresh throwed an error from fullcalendar lib. Also when going back to the calendar view, it would not be loaded. It is due to fullcalendar not being rendered if it is not visible, and other part of the Odoo code are dependent on it having been rendered. This commit hide the calendar after having been rendered. closes #10253 opw-659314
Diffstat (limited to 'addons/web/static/src/js/view_manager.js')
-rw-r--r--addons/web/static/src/js/view_manager.js16
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