mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_responsive: Hide document viewer on App switcher
Fix to close attachment viewer automatically when moving to other app Updated code for fix Updated code for fix Updated code for fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
/* Copyright 2018 Tecnativa - Jairo Llopis
|
||||
* Copyright 2021 ITerra - Sergey Shebanin
|
||||
* Copyright 2021 Onestein - Anjeel Haria
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
import {NavBar} from "@web/webclient/navbar/navbar";
|
||||
@@ -14,6 +15,7 @@ import {patch} from "web.utils";
|
||||
|
||||
const {Component} = owl;
|
||||
const {useState, useRef} = owl.hooks;
|
||||
import {unlinkAll} from "@mail/model/model_field_command";
|
||||
|
||||
// Patch WebClient to show AppsMenu instead of default app
|
||||
patch(WebClient.prototype, "web_responsive.DefaultAppsMenu", {
|
||||
@@ -32,8 +34,12 @@ export class AppsMenu extends Component {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.state = useState({open: false});
|
||||
useBus(this.env.bus, "ACTION_MANAGER:UI-UPDATED", () => {
|
||||
useBus(this.env.bus, "ACTION_MANAGER:UI-UPDATED", async () => {
|
||||
this.setState(false);
|
||||
const messaging = await Component.env.services.messaging.get();
|
||||
messaging.dialogManager.update({
|
||||
dialogs: unlinkAll(),
|
||||
});
|
||||
});
|
||||
useBus(this.env.bus, "APPS_MENU:CLOSE", () => {
|
||||
this.setState(false);
|
||||
|
||||
@@ -54,3 +54,7 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.o_apps_menu_opened .o_AttachmentViewer {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user