diff --git a/code_backend_theme/__manifest__.py b/code_backend_theme/__manifest__.py index a945d292..2aeac9b6 100644 --- a/code_backend_theme/__manifest__.py +++ b/code_backend_theme/__manifest__.py @@ -34,11 +34,14 @@ "data": [ 'views/layout.xml', 'views/icons.xml', + # 'views/navbar.xml' ], 'assets': { 'web.assets_backend': [ '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', + 'code_backend_theme/static/src/xml/navbar.xml', 'code_backend_theme/static/src/scss/theme_accent.scss', 'code_backend_theme/static/src/scss/navigation_bar.scss', 'code_backend_theme/static/src/scss/datetimepicker.scss', diff --git a/code_backend_theme/static/src/icon/caret-down.svg b/code_backend_theme/static/src/icon/caret-down.svg new file mode 100644 index 00000000..1833ee38 --- /dev/null +++ b/code_backend_theme/static/src/icon/caret-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/code_backend_theme/static/src/js/chrome/sidebar_menu.js b/code_backend_theme/static/src/js/chrome/sidebar_menu.js index dea10307..154226bc 100644 --- a/code_backend_theme/static/src/js/chrome/sidebar_menu.js +++ b/code_backend_theme/static/src/js/chrome/sidebar_menu.js @@ -1,6 +1,7 @@ odoo.define('code_backend_theme.SidebarMenu', function (require) { "use strict"; //鼠标点击侧边导航栏,对应的导航选项卡的显隐 + // console.log($('.d-block').css()) $(document).on("click", '.sidebar_menu li', function (event) { var aA = $(this).children('.d-md-flex').children() var aLi = $(this).parent().children() @@ -25,15 +26,16 @@ odoo.define('code_backend_theme.SidebarMenu', function (require) { } } }) + //鼠标点击二级菜单,svg图标随着三级菜单的显隐而切换 - $(document).on("mouseover", '.sidebar_menu li', function (event) { - $('.sidebar_menu li').off() - $(this).css({'background-color': '#fff !important'}) - }) - $(document).on("mouseleave", '.sidebar_menu li', function (event) { - $(this).css({'background-color': '#ccc !important'}) - }) + // $(document).on("mouseover", '.sidebar_menu li', function (event) { + // $('.sidebar_menu li').off() + // $(this).css({'background-color': '#fff !important'}) + // }) + // $(document).on("mouseleave", '.sidebar_menu li', function (event) { + // $(this).css({'background-color': '#ccc !important'}) + // }) //sidebar toggle effect $(document).on("click", "#closeSidebar", function (event) { $("#closeSidebar").hide(); @@ -45,8 +47,8 @@ odoo.define('code_backend_theme.SidebarMenu', function (require) { }); $(document).on("click", "#openSidebar", function (event) { $("#sidebar_panel").css({'display': 'block'}); - $(".o_action_manager").css({'margin-left': '200px', 'transition': 'all .1s linear'}); - $(".top_heading").css({'margin-left': '200px', 'transition': 'all .1s linear', 'width': 'auto'}); + $(".o_action_manager").css({'margin-left': '250px', 'transition': 'all .1s linear'}); + $(".top_heading").css({'margin-left': '250px', 'transition': 'all .1s linear', 'width': 'auto'}); //add class in navbar var navbar = $(".o_main_navbar"); diff --git a/code_backend_theme/static/src/scss/change.scss b/code_backend_theme/static/src/scss/change.scss index 0a379f23..f625683e 100644 --- a/code_backend_theme/static/src/scss/change.scss +++ b/code_backend_theme/static/src/scss/change.scss @@ -1,3 +1,7 @@ +#sidebar_panel { + width: 250px !important; +} + .o_menu_sections { display: flex; flex-direction: column; @@ -12,9 +16,9 @@ background-color: transparent; } -//.o_menu_sections { -// background-color: transparent !important; -//} +.o_menu_sections { + background-color: unset !important; +} .d-md-flex { visibility: hidden; @@ -41,3 +45,71 @@ .nav-link { box-shadow: 0px 0px 2px #fff; } + +.sidebar_menu li:hover .dropdown-item { + background-color: unset !important; +} + +.sidebar_menu li:hover .o-dropdown { + background-color: unset !important; + transition: .3s all; +} + +.sidebar_menu li .o-dropdown { + background-color: unset !important; + cursor: pointer; + padding-left: 53px !important; +} + +.o_menu_sections .dropdown-menu { + position: unset !important; + background-color: unset; +} + +.sidebar_menu li .o_menu_sections > a { + padding-left: 53px !important; +} + +.sidebar_menu li:hover .dropdown-menu a, +.sidebar_menu li:hover .dropdown-menu { + background-color: unset !important; +} + +.o_menu_sections .dropdown-menu .dropdown-menu_group { + color: #ccc; + background-color: unset; + padding-bottom: 0.5rem !important; + padding-left: 89px; +} + +.o_menu_sections .dropdown-menu { + width: 250px !important; + margin-left: -75px !important; + max-height: unset !important; + box-shadow: unset !important; + border: none; +} + +.o-dropdown--menu .dropdown-item.focus { + background-color: unset !important; +} + +.dropdown-menu .dropdown-item { + padding-left: 103px !important; +} + +svg { + width: 18px; + height: 18px; +} + +svg:nth-of-type(1) { + display: none; +} + +.dropdown-toggle { + width: 100% !important; + display: flex; + justify-content: space-between; +} + diff --git a/code_backend_theme/static/src/xml/navbar.xml b/code_backend_theme/static/src/xml/navbar.xml new file mode 100644 index 00000000..fa3970fc --- /dev/null +++ b/code_backend_theme/static/src/xml/navbar.xml @@ -0,0 +1,68 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
\ No newline at end of file