mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-20 18:07:59 +02:00
Fix error when hide-desktop-navigation is true
This commit is contained in:
parent
9de6843a2e
commit
95702a2e53
@ -689,9 +689,13 @@ async function changeTheme(key, onChanged) {
|
||||
}
|
||||
|
||||
function initThemeSwitcher() {
|
||||
find(".mobile-navigation .theme-choices").replaceWith(
|
||||
find(".header-container .theme-choices").cloneNode(true)
|
||||
);
|
||||
const themeChoicesInHeader = find(".header-container .theme-choices");
|
||||
|
||||
if (themeChoicesInHeader) {
|
||||
themeChoicesInHeader.replaceWith(
|
||||
find(".mobile-navigation .theme-choices").cloneNode(true)
|
||||
);
|
||||
}
|
||||
|
||||
const presetElems = findAll(".theme-choices .theme-preset");
|
||||
let themePreviewElems = document.getElementsByClassName("current-theme-preview");
|
||||
|
@ -38,12 +38,7 @@
|
||||
{{ .Request.Theme.PreviewHTML }}
|
||||
</div>
|
||||
<div data-popover-html>
|
||||
<div class="theme-choices">
|
||||
{{ .App.Config.Theme.PreviewHTML }}
|
||||
{{ range $_, $preset := .App.Config.Theme.Presets.Items }}
|
||||
{{ $preset.PreviewHTML }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="theme-choices"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{- if .App.RequiresAuth }}
|
||||
@ -73,7 +68,12 @@
|
||||
<div class="mobile-navigation-actions flex flex-column margin-block-10">
|
||||
<div class="theme-picker flex justify-between items-center" data-popover-type="html" data-popover-position="above" data-popover-show-delay="0" data-popover-hide-delay="100" data-popover-anchor=".current-theme-preview" data-popover-trigger="click">
|
||||
<div data-popover-html>
|
||||
<div class="theme-choices"></div>
|
||||
<div class="theme-choices">
|
||||
{{ .App.Config.Theme.PreviewHTML }}
|
||||
{{ range $_, $preset := .App.Config.Theme.Presets.Items }}
|
||||
{{ $preset.PreviewHTML }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="size-h3 pointer-events-none select-none">Change theme</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user