forked from Techsystech/web
[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 fix15.0-ocabot-merge-pr-2789-by-pedrobaeza-bump-patch
parent
f62ffa8f76
commit
1ba43a6d6f
|
@ -1,6 +1,7 @@
|
||||||
/** @odoo-module **/
|
/** @odoo-module **/
|
||||||
/* Copyright 2018 Tecnativa - Jairo Llopis
|
/* Copyright 2018 Tecnativa - Jairo Llopis
|
||||||
* Copyright 2021 ITerra - Sergey Shebanin
|
* Copyright 2021 ITerra - Sergey Shebanin
|
||||||
|
* Copyright 2021 Onestein - Anjeel Haria
|
||||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||||
|
|
||||||
import {NavBar} from "@web/webclient/navbar/navbar";
|
import {NavBar} from "@web/webclient/navbar/navbar";
|
||||||
|
@ -14,6 +15,7 @@ import {patch} from "web.utils";
|
||||||
|
|
||||||
const {Component} = owl;
|
const {Component} = owl;
|
||||||
const {useState, useRef} = owl.hooks;
|
const {useState, useRef} = owl.hooks;
|
||||||
|
import {unlinkAll} from "@mail/model/model_field_command";
|
||||||
|
|
||||||
// Patch WebClient to show AppsMenu instead of default app
|
// Patch WebClient to show AppsMenu instead of default app
|
||||||
patch(WebClient.prototype, "web_responsive.DefaultAppsMenu", {
|
patch(WebClient.prototype, "web_responsive.DefaultAppsMenu", {
|
||||||
|
@ -32,8 +34,12 @@ export class AppsMenu extends Component {
|
||||||
setup() {
|
setup() {
|
||||||
super.setup();
|
super.setup();
|
||||||
this.state = useState({open: false});
|
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);
|
this.setState(false);
|
||||||
|
const messaging = await Component.env.services.messaging.get();
|
||||||
|
messaging.dialogManager.update({
|
||||||
|
dialogs: unlinkAll(),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
useBus(this.env.bus, "APPS_MENU:CLOSE", () => {
|
useBus(this.env.bus, "APPS_MENU:CLOSE", () => {
|
||||||
this.setState(false);
|
this.setState(false);
|
||||||
|
|
|
@ -54,3 +54,7 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.o_apps_menu_opened .o_AttachmentViewer {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue