mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-22 02:21:37 +01:00
open toc on wide displays
This commit is contained in:
parent
dfe6ecc550
commit
b9e4f627cc
@ -104,7 +104,16 @@ function showCodeCopyButtons() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openToc() {
|
||||||
|
var toc = document.getElementById("toc");
|
||||||
|
|
||||||
|
if (toc && window.screen.width > 1500 && window.screen.height > 800) {
|
||||||
|
toc.open = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
initializeMenu();
|
initializeMenu();
|
||||||
|
openToc()
|
||||||
if (params.scrollToTop) scrollToTop();
|
if (params.scrollToTop) scrollToTop();
|
||||||
if (params.themeToggle) themeToggle();
|
if (params.themeToggle) themeToggle();
|
||||||
if (params.showCodeCopyButtons) showCodeCopyButtons();
|
if (params.showCodeCopyButtons) showCodeCopyButtons();
|
@ -2,7 +2,7 @@
|
|||||||
{{- $has_headers := ge (len $headers) 1 -}}
|
{{- $has_headers := ge (len $headers) 1 -}}
|
||||||
{{- if $has_headers -}}
|
{{- if $has_headers -}}
|
||||||
<div class="toc side">
|
<div class="toc side">
|
||||||
<details {{if (.Param "TocOpen") }} open{{ end }}>
|
<details id="toc" {{if (.Param "TocOpen") }} open{{ end }}>
|
||||||
<summary accesskey="c" title="(Alt + C)">
|
<summary accesskey="c" title="(Alt + C)">
|
||||||
<span class="details">{{- i18n "toc" | default "Table of Contents" }}</span>
|
<span class="details">{{- i18n "toc" | default "Table of Contents" }}</span>
|
||||||
</summary>
|
</summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user