diff --git a/web_responsive/__manifest__.py b/web_responsive/__manifest__.py
index e23ee1f55..03a57635a 100644
--- a/web_responsive/__manifest__.py
+++ b/web_responsive/__manifest__.py
@@ -18,6 +18,10 @@
"maintainers": ["Yajo", "Tardo", "SplashS"],
"data": ["views/res_users.xml", "views/web.xml"],
"assets": {
+ "web.assets_frontend": [
+ "/web_responsive/static/src/legacy/js/website_apps_menu.js",
+ "/web_responsive/static/src/legacy/css/website_apps_menu.scss",
+ ],
"web.assets_backend": [
"/web_responsive/static/src/legacy/css/web_responsive.scss",
"/web_responsive/static/src/legacy/js/web_responsive.js",
diff --git a/web_responsive/static/src/components/apps_menu/apps_menu.esm.js b/web_responsive/static/src/components/apps_menu/apps_menu.esm.js
index 1c74c6e62..02146c74d 100644
--- a/web_responsive/static/src/components/apps_menu/apps_menu.esm.js
+++ b/web_responsive/static/src/components/apps_menu/apps_menu.esm.js
@@ -10,10 +10,34 @@ import {useHotkey} from "@web/core/hotkeys/hotkey_hook";
import {scrollTo} from "@web/core/utils/scrolling";
import {debounce} from "@web/core/utils/timing";
import {fuzzyLookup} from "@web/core/utils/search";
+import {WebClient} from "@web/webclient/webclient";
+import {patch} from "web.utils";
const {Component} = owl;
const {useState, useRef} = owl.hooks;
+// Patch WebClient to show AppsMenu instead of default app
+patch(WebClient.prototype, "web_responsive.DefaultAppsMenu", {
+ setup() {
+ this._super();
+ useBus(Dropdown.bus, "state-changed", (payload) => {
+ if (payload.emitter.el.classList.contains("o_navbar_apps_menu")) {
+ this.el.classList.toggle("o_apps_menu_opened", payload.newState.open);
+ this.el.classList.toggle("o_first_app", false);
+ }
+ });
+ },
+ _loadDefaultApp() {
+ var menu_apps_dropdown = document.querySelector(
+ ".o_navbar_apps_menu .dropdown-toggle"
+ );
+ menu_apps_dropdown.click();
+ this.el.classList.toggle("o_apps_menu_opened", true);
+ this.el.classList.toggle("o_first_app", true);
+ return true;
+ },
+});
+
/**
* @extends Dropdown
*/
diff --git a/web_responsive/static/src/components/apps_menu/apps_menu.scss b/web_responsive/static/src/components/apps_menu/apps_menu.scss
index 0e5ccc183..d67bc6c8b 100644
--- a/web_responsive/static/src/components/apps_menu/apps_menu.scss
+++ b/web_responsive/static/src/components/apps_menu/apps_menu.scss
@@ -12,6 +12,17 @@
width: 100vw;
z-index: 200;
left: 0 !important;
+ top: $o-navbar-height !important;
+}
+
+.o_first_app .o_navbar_apps_menu .dropdown-toggle {
+ display: none;
+}
+.o_apps_menu_opened .o_main_navbar {
+ .o_menu_brand,
+ .o_menu_sections {
+ display: none;
+ }
}
// Iconized full screen apps menu
diff --git a/web_responsive/static/src/legacy/css/website_apps_menu.scss b/web_responsive/static/src/legacy/css/website_apps_menu.scss
new file mode 100644
index 000000000..d0c319f49
--- /dev/null
+++ b/web_responsive/static/src/legacy/css/website_apps_menu.scss
@@ -0,0 +1,35 @@
+/* Copyright 2021 ITerra - Sergey Shebanin
+ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
+
+// Website main navbar and his AppsMenu button
+#oe_main_menu_navbar {
+ .dropdown-toggle::after {
+ display: none;
+ }
+ a.full {
+ > i {
+ padding: 0 10px 0 0;
+ font-size: 17px;
+ }
+ font-size: 20px;
+ line-height: 46px;
+ @include media-breakpoint-down(sm) {
+ width: 46px;
+ overflow: hidden;
+ }
+ }
+ #oe_applications.o_responsive_loaded {
+ a.full {
+ width: 46px;
+ overflow: hidden;
+ }
+ }
+ .o_menu_brand {
+ white-space: nowrap;
+ padding: 0 16px 0 4px;
+ text-transform: capitalize;
+ @include media-breakpoint-down(sm) {
+ display: none;
+ }
+ }
+}
diff --git a/web_responsive/static/src/legacy/js/website_apps_menu.js b/web_responsive/static/src/legacy/js/website_apps_menu.js
new file mode 100644
index 000000000..c8ae77974
--- /dev/null
+++ b/web_responsive/static/src/legacy/js/website_apps_menu.js
@@ -0,0 +1,52 @@
+/* Copyright 2021 Sergey Shebanin
+ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
+
+odoo.define("web_responsive.website_apps_menu", function (require) {
+ "use strict";
+ /*
+ * We can't require anything from website here because `web_responsive` doesn't depend on `website`.
+ * In this case we will try to get WebsiteNavbar class through the PublicRoot registry.
+ * WebsiteNavbar can be unavailable if `website` is not installed. In this case this file do nothing.
+ */
+ const publicRoot = require("root.widget");
+ const lazyloader = require("web.public.lazyloader");
+ const registry = publicRoot._getRegistry();
+
+ function patchNavbar() {
+ const navbar = registry.get("WebsiteNavbar", false);
+ if (!navbar) return false;
+ navbar.Widget.include({
+ /**
+ * We don't need to load app menus
+ * @override
+ */
+ async _loadAppMenus() {
+ return Promise.resolve();
+ },
+ /**
+ * We add a spinner for the user to understand the loading
+ * @override
+ */
+ _onOeApplicationsShow: function () {
+ const icon = $(
+ document.querySelector("#oe_main_menu_navbar a.full > i")
+ );
+ icon.removeClass("fa fa-th-large").append(
+ $("", {class: "fa fa-spin fa-spinner"})
+ );
+ window.location.href = "/web#home";
+ // Prevent dropdown to be showed
+ return false;
+ },
+ });
+ const menu = $("#oe_applications");
+ menu.addClass("o_responsive_loaded").after(
+ "" + menu.find("a.full").text() + ""
+ );
+ return true;
+ }
+ // Try to patch navbar. If it is not in registry - make another try after lazyload
+ if (!patchNavbar()) {
+ lazyloader.allScriptsLoaded.then(patchNavbar);
+ }
+});