修复手机端自动展开菜单的问题 (#15)
Build and Publish / Run (push) Successful in 5m35s Details

Reviewed-on: study-area-cn/study-area-cn#15
This commit is contained in:
cxykevin 2024-08-11 15:02:16 +08:00
parent d791a0b76d
commit 6bd928d8db
3 changed files with 7 additions and 1 deletions

View File

@ -18,4 +18,5 @@ additional-js = [
"theme/js/highlight.min.js",
"theme/js/mathjax.js",
"theme/js/tocrender.js",
"theme/js/page.js",
]

View File

@ -84,7 +84,7 @@
{{/if}}
</mdui-top-app-bar>
<mdui-navigation-drawer close-on-overlay-click class="toc-drawer" id="toc-drawer" placement="left" open>
<mdui-navigation-drawer close-on-overlay-click class="toc-drawer" id="toc-drawer" placement="left">
</mdui-navigation-drawer>
{{/unless}}
@ -201,6 +201,8 @@
<script>hljs.highlightAll();</script>
<script src="{{ ../path_to_root }}theme/js/page.js"></script>
</body>
</html>

3
theme/js/page.js Normal file
View File

@ -0,0 +1,3 @@
if (window.innerWidth > 640) {
document.getElementById("toc-drawer").setAttribute('open', true)
}