From 65ec935a9f3898a6dd7a563d6bf13feea5de1a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?WEB=E8=AE=B8=E4=BD=95=E5=93=B2=5Cxuhez?= Date: Mon, 26 Jun 2023 17:35:55 +0800 Subject: [PATCH] =?UTF-8?q?0626=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code_backend_theme/__manifest__.py | 2 ++ .../static/src/js/chrome/myDropdown.js | 11 ++++++++ .../static/src/scss/change.scss | 25 ++++++++++++++++--- code_backend_theme/static/src/xml/navbar.xml | 2 ++ 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 code_backend_theme/static/src/js/chrome/myDropdown.js diff --git a/code_backend_theme/__manifest__.py b/code_backend_theme/__manifest__.py index af7f1737..196dd795 100644 --- a/code_backend_theme/__manifest__.py +++ b/code_backend_theme/__manifest__.py @@ -38,6 +38,7 @@ ], 'assets': { 'web.assets_backend': [ + 'code_backend_theme/static/src/js/chrome/myDropdown.js', 'code_backend_theme/static/src/xml/styles.xml', 'code_backend_theme/static/src/xml/top_bar.xml', # 'code_backend_theme/static/src/xml/dropdown.xml', @@ -51,6 +52,7 @@ 'code_backend_theme/static/src/js/chrome/sidebar_menu.js', 'code_backend_theme/static/src/js/chrome/test.js', 'code_backend_theme/static/src/js/fields/colors.js', + ], 'web.assets_frontend': [ 'code_backend_theme/static/src/scss/login.scss', diff --git a/code_backend_theme/static/src/js/chrome/myDropdown.js b/code_backend_theme/static/src/js/chrome/myDropdown.js new file mode 100644 index 00000000..89860b86 --- /dev/null +++ b/code_backend_theme/static/src/js/chrome/myDropdown.js @@ -0,0 +1,11 @@ +/** @odoo-module **/ + +import {Dropdown} from "@web/core/dropdown/dropdown" + +var {patch} = require("web.utils") + +patch(Dropdown.prototype, "Dropdown.DropdownJS", { + close() { + return this.changeStateAndNotify({open: true, groupIsOpen: true}); + } +}) \ No newline at end of file diff --git a/code_backend_theme/static/src/scss/change.scss b/code_backend_theme/static/src/scss/change.scss index 73fc6678..276dcdef 100644 --- a/code_backend_theme/static/src/scss/change.scss +++ b/code_backend_theme/static/src/scss/change.scss @@ -31,7 +31,7 @@ padding-bottom: 5px !important; } -.o-dropdown { +.sidebar_menu .o-dropdown { padding-left: 25px; padding-top: 8px; padding-bottom: 0px; @@ -94,7 +94,7 @@ background-color: unset !important; } -.dropdown-menu .dropdown-item { +.sidebar_menu .dropdown-menu .dropdown-item { padding-left: 103px !important; } @@ -115,7 +115,7 @@ svg:nth-of-type(1) { //$caret-width: 80px; // -.dropdown-toggle[aria-expanded="false"] :after { +.sidebar_menu .dropdown-toggle[aria-expanded="false"] :after { display: inline-block; width: 0; height: 0; @@ -128,7 +128,7 @@ svg:nth-of-type(1) { border-left: $caret-width solid transparent; } -.dropdown-toggle[aria-expanded="true"]:after { +.sidebar_menu .dropdown-toggle[aria-expanded="true"]:after { display: inline-block; width: 0; height: 0; @@ -142,3 +142,20 @@ svg:nth-of-type(1) { border-bottom: $caret-width solid; } +.text-truncate { + overflow: unset !important; + text-overflow: unset !important; +} + +.o_list_controller { + width: 41px !important; +} + +.o_main_navbar .dropdown-toggle { + height: 100% !important; +} + +.MessagingMenuContainer { + display: flex; + align-items: center; +} diff --git a/code_backend_theme/static/src/xml/navbar.xml b/code_backend_theme/static/src/xml/navbar.xml index 2132a05c..abe1f7bf 100644 --- a/code_backend_theme/static/src/xml/navbar.xml +++ b/code_backend_theme/static/src/xml/navbar.xml @@ -67,7 +67,9 @@ + + \ No newline at end of file