[FIX] website: allow to exit fullscreen if not on website anymore
While showcasing your website inside the website application, there is the possibility to hit the escape key to enter fullscreen (hiding the backend navbar outside edit mode and the editor panel during edit mode). There was a problem following this flow: - Go to your website inside your website app - Hit escape to enter fullscreen - Press CTRL-K to switch to another part of the backend => You are now somewhere in the backend, without the navbar (fullscreen) and you cannot exit it. As it was a one-line fix (except for the re-indentation), this commit now allows to exit fullscreen mode wherever we are. Discovered during task-3082439 X-original-commit: bd225ec782e26c87301e9e786ffd7250ad62ebfc Part-of: odoo/odoo#106735
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user