like this?

This commit is contained in:
2026-03-23 14:59:54 +01:00
committed by Florian Greistorfer
parent a7a0fee815
commit ad6ef5fe01

View File

@@ -10,12 +10,14 @@ class PhotoGallery {
this.darkModeToggle = this.darkModeToggle.bind(this); this.darkModeToggle = this.darkModeToggle.bind(this);
this.debounce = this.debounce.bind(this); this.debounce = this.debounce.bind(this);
this.detectDarkMode = this.detectDarkMode.bind(this); this.detectDarkMode = this.detectDarkMode.bind(this);
this.detectDarkMode();
this.filter = this.filter.bind(this); this.filter = this.filter.bind(this);
this.finalize = this.finalize.bind(this); this.finalize = this.finalize.bind(this);
this.insertPath = this.insertPath.bind(this); this.insertPath = this.insertPath.bind(this);
this.lightMode = this.lightMode.bind(this); this.lightMode = this.lightMode.bind(this);
this.onLoad = this.onLoad.bind(this); this.onLoad = this.onLoad.bind(this);
this.onPageShow = this.onPageShow.bind(this);
this.openSwipe = this.openSwipe.bind(this); this.openSwipe = this.openSwipe.bind(this);
this.parseHierarchicalTags = this.parseHierarchicalTags.bind(this); this.parseHierarchicalTags = this.parseHierarchicalTags.bind(this);
this.prefetch = this.prefetch.bind(this); this.prefetch = this.prefetch.bind(this);
@@ -208,10 +210,6 @@ class PhotoGallery {
window.addEventListener("scroll", this.scrollFunction); window.addEventListener("scroll", this.scrollFunction);
} }
onPageShow() {
this.detectDarkMode();
}
openSwipe(imgIndex) { openSwipe(imgIndex) {
const options = { index: imgIndex }; const options = { index: imgIndex };
const gallery = new PhotoSwipe(this.pswpElement, PhotoSwipeUI_Default, this.shown, options); const gallery = new PhotoSwipe(this.pswpElement, PhotoSwipeUI_Default, this.shown, options);
@@ -532,11 +530,6 @@ class PhotoGallery {
} }
init() { init() {
if (window.addEventListener) {
window.addEventListener("pageshow", this.onPageShow, false);
} else if (window.attachEvent) {
window.attachEvent("pageshow", this.onPageShow);
}
if (window.addEventListener) { if (window.addEventListener) {
window.addEventListener("load", this.onLoad, false); window.addEventListener("load", this.onLoad, false);
} else if (window.attachEvent) { } else if (window.attachEvent) {