Docs menu lvl1 expand script port2master (#14570)

* JS for expanding menu lvl1
Script by Kasia Bojarowska
This commit is contained in:
Karol Blaszczak 2022-12-12 13:59:13 +01:00 committed by GitHub
parent 062fb60def
commit 121d4efabd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 8 deletions

View File

@ -24,23 +24,30 @@ ul#navbar-main-elements li:first-of-type {
#bd-docs-nav div ul a:hover { #bd-docs-nav div ul a:hover {
text-decoration: underline; text-decoration: underline;
} }
/* top bar items on hover */
ul#navbar-main-elements > li:hover { ul#navbar-main-elements > li:hover {
text-decoration: underline; text-decoration: underline;
} }
/* first level items in the side menu */
/* first-level items in the side menu */
#bd-docs-nav > div > ul > li {
padding-bottom: 15px;
}
#bd-docs-nav > div > ul > li > a { #bd-docs-nav > div > ul > li > a {
color: #0068B5; color: #000000;
padding-bottom: 0; font-weight: bold;
} }
/* second level items */ /* second level items */
#bd-docs-nav > div > ul > li > ul { #bd-docs-nav > div > ul > li > ul {
padding-left: 0.5rem; padding-left: 0.3rem;
} }
#bd-docs-nav div ul li ul li a { /* overwrite menu chevron directions for open and closed states */
padding-top: 0; .toctree-checkbox~label i {
/*padding-bottom: 0; */ transform: rotate(270deg);
} }
.toctree-checkbox:checked~label i {
transform: rotate(0deg);
}

7
docs/_static/js/open_sidebar.js vendored Normal file
View File

@ -0,0 +1,7 @@
$(document).ready(function() {
const elems = $( "ul.bd-sidenav > li > input" )
console.log(elems)
for(let i = 0; i < elems.length; i++){
elems[i].setAttribute("checked", "checked");
}
})

View File

@ -181,4 +181,5 @@ def setup(app):
app.add_js_file('js/custom.js') app.add_js_file('js/custom.js')
app.add_js_file('js/graphs.js') app.add_js_file('js/graphs.js')
app.add_js_file('js/graphs_ov_tf.js') app.add_js_file('js/graphs_ov_tf.js')
app.add_js_file('js/open_sidebar.js')