Skip to content

Commit 1dd4dc2

Browse files
committed
Deploy Logseq SPA @ 2d158c2aede67fe9016d3b9f489444af37c596a3 jjohare/logseq@2d158c2
1 parent f5f327a commit 1dd4dc2

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

notes/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

notes/static/css/custom.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ html.ls-pres-mode .ls-pres-active .page-properties {
8383
padding: 0 !important;
8484
}
8585

86-
/* Hide collapsed sections — both children and header blocks */
87-
html.ls-pres-mode .ls-pres-active .ls-block[data-collapsed="true"],
86+
/* Hide collapsed sections — SPA sets data-collapsed to a DB-id, not "true" */
87+
html.ls-pres-mode .ls-pres-active .ls-block[data-collapsed],
8888
html.ls-pres-mode .ls-pres-active .ls-block.collapsed {
8989
display: none !important;
9090
}

notes/static/js/custom.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,19 @@
117117
/* ── hide collapsed section headers within a slide ─────── */
118118
function hideCollapsedBlocks(slideEl) {
119119
slideEl.querySelectorAll('.ls-block').forEach(function (block) {
120-
/* Method 1: data attribute or class set by Logseq */
121-
if (block.getAttribute('data-collapsed') === 'true' || block.classList.contains('collapsed')) {
120+
/* Method 1: SPA sets data-collapsed to a DB-id string (not "true").
121+
Any truthy value means the block is collapsed. */
122+
if (block.hasAttribute('data-collapsed') || block.classList.contains('collapsed')) {
122123
block.classList.add('ls-pres-hidden');
123124
return;
124125
}
125-
/* Method 2: detect collapsed-section-header pattern.
126-
These are short text blocks whose .block-children exist
127-
but have zero visible height (i.e. content is collapsed). */
128126
var bc = block.querySelector('.block-content');
129127
if (!bc) return;
130128
/* keep blocks with headings or media */
131129
if (bc.querySelector('h1, h2, h3, h4, h5, h6, img, video, table, iframe')) return;
132130
var text = bc.textContent.trim();
133-
/* short text (collapsed label), not empty */
134131
if (text.length === 0 || text.length > 120) return;
135-
/* has "collapsed" in its own text (SPA may render the property inline) */
132+
/* has "collapsed" in text (fallback for other renderings) */
136133
if (/collapsed/i.test(text)) {
137134
block.classList.add('ls-pres-hidden');
138135
return;

0 commit comments

Comments
 (0)