diff --git a/addons/website/static/src/services/website_service.js b/addons/website/static/src/services/website_service.js index 2b6d4a0b8afcc6584fb917d8f6a077807fab4beb..5c474c1d165ef094a470a874cdb15c1b9343c4ab 100644 --- a/addons/website/static/src/services/website_service.js +++ b/addons/website/static/src/services/website_service.js @@ -57,11 +57,15 @@ export const websiteService = { hotkey.add("escape", () => { // Toggle fullscreen mode when pressing escape. - if (currentWebsiteId) { - fullscreen = !fullscreen; - document.body.classList.toggle('o_website_fullscreen', fullscreen); - bus.trigger((fullscreen ? 'FULLSCREEN-INDICATION-SHOW' : 'FULLSCREEN-INDICATION-HIDE')); + if (!currentWebsiteId && !fullscreen) { + // Only allow to use this feature while on the website app, or + // while it is already fullscreen (in case you left the website + // app in fullscreen mode, thanks to CTRL-K). + return; } + fullscreen = !fullscreen; + document.body.classList.toggle('o_website_fullscreen', fullscreen); + bus.trigger(fullscreen ? 'FULLSCREEN-INDICATION-SHOW' : 'FULLSCREEN-INDICATION-HIDE'); }, { global: true }); registry.category('main_components').add('FullscreenIndication', { Component: FullscreenIndication,