modern shit

This commit is contained in:
2026-07-23 21:25:38 +02:00
parent b319f21cd4
commit 4dfb80b149
2 changed files with 11 additions and 5 deletions

View File

@@ -54,7 +54,7 @@ class CommentSystem {
document.body.classList.remove('sidebar-left-hidden'); document.body.classList.remove('sidebar-left-hidden');
const layout = this.container.closest('.item-layout-container'); const layout = this.container.closest('.item-layout-container');
if (layout) layout.classList.remove('sidebar-hidden'); if (layout) layout.classList.remove('sidebar-hidden');
} else if (isHidden) { } else if (isHidden && (window.innerWidth >= 1000 || !document.body.classList.contains('layout-modern'))) {
this.container.classList.add('faded-out'); this.container.classList.add('faded-out');
this.container.style.display = 'none'; this.container.style.display = 'none';
document.body.classList.add('sidebar-left-hidden'); document.body.classList.add('sidebar-left-hidden');
@@ -3808,9 +3808,12 @@ class CommentSystem {
toggleComments() { toggleComments() {
if (!this.container) return; if (!this.container) return;
if (document.body.classList.contains('layout-modern') && typeof window.toggleSidebarLeft === 'function') { if (document.body.classList.contains('layout-modern')) {
window.toggleSidebarLeft(); if (window.innerWidth < 1000) return;
return; if (typeof window.toggleSidebarLeft === 'function') {
window.toggleSidebarLeft();
return;
}
} }
const layout = this.container.closest('.item-layout-container'); const layout = this.container.closest('.item-layout-container');

View File

@@ -6811,7 +6811,9 @@ window.cancelAnimFrame = (function () {
}); });
const isLSActive = () => const isLSActive = () =>
document.body.classList.contains('layout-modern') && !!document.querySelector('.item-sidebar-left'); document.body.classList.contains('layout-modern') &&
!!document.querySelector('.item-sidebar-left') &&
window.innerWidth >= 1000;
// Prepare sidebar for drag — keeps it in the CSS grid so overflow:hidden clips translateX. // Prepare sidebar for drag — keeps it in the CSS grid so overflow:hidden clips translateX.
// OPEN: removes sidebar-hidden/display:none, places sidebar at translateX(-sw), reflows twice. // OPEN: removes sidebar-hidden/display:none, places sidebar at translateX(-sw), reflows twice.
@@ -7070,6 +7072,7 @@ window.cancelAnimFrame = (function () {
}; };
window.toggleSidebarLeft = () => { window.toggleSidebarLeft = () => {
if (window.innerWidth < 1000) return;
const { sb, layout } = getLS(); const { sb, layout } = getLS();
if (!sb || !layout) return; if (!sb || !layout) return;
const isHidden = layout.classList.contains('sidebar-hidden'); const isHidden = layout.classList.contains('sidebar-hidden');