From 15bcae2dc026e64d20bae2c815c70274ff09e3fb Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 28 Nov 2018 10:54:00 +0000 Subject: [PATCH] [FIX] web: action manager fullscreen toggle From a standard view with the main menu (what is called a target=current action) open a target=fullscreen action Then, go back to the first action, with the breadcrumbs for example Before this commit, the original view was displayed fullscreen, which impaired business navigation because the main menu was not there anymore After this commit, the original view has the main menu OPW 1906373 closes odoo/odoo#29096 --- .../static/src/js/chrome/action_manager.js | 6 +- .../tests/chrome/action_manager_tests.js | 73 +++++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js index 0dae6b64808..fe62d633e1e 100644 --- a/addons/web/static/src/js/chrome/action_manager.js +++ b/addons/web/static/src/js/chrome/action_manager.js @@ -360,9 +360,6 @@ var ActionManager = Widget.extend({ // update the internal state and the DOM self._pushController(controller, options); - // toggle the fullscreen mode for actions in target='fullscreen' - self._toggleFullscreen(); - // store the action into the sessionStorage so that it can be // fully restored on F5 self.call('session_storage', 'setItem', 'current_action', action._originalAction); @@ -751,6 +748,9 @@ var ActionManager = Widget.extend({ action: this.getCurrentAction(), controller: controller, }); + + // toggle the fullscreen mode for actions in target='fullscreen' + this._toggleFullscreen(); }, /** * Pushes the given state, with additional information about the given diff --git a/addons/web/static/tests/chrome/action_manager_tests.js b/addons/web/static/tests/chrome/action_manager_tests.js index d88d0dbf944..cd123225357 100644 --- a/addons/web/static/tests/chrome/action_manager_tests.js +++ b/addons/web/static/tests/chrome/action_manager_tests.js @@ -3409,6 +3409,79 @@ QUnit.module('ActionManager', { actionManager.destroy(); }); + QUnit.test('fullscreen on action change: back to a "current" action', function (assert) { + assert.expect(3); + + this.actions[0].target = 'fullscreen'; + this.archs['partner,false,form'] = '
' + + '