From f400a43640e7106d181d55365a9617c3d12e5891 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 29 Dec 2023 22:59:20 -0400 Subject: content: misc content syntax cleanup, mostly attribute merging --- .../generateAlbumSidebarTrackSection.js | 55 ++++++++++------------ 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'src/content/dependencies/generateAlbumSidebarTrackSection.js') diff --git a/src/content/dependencies/generateAlbumSidebarTrackSection.js b/src/content/dependencies/generateAlbumSidebarTrackSection.js index d3cd37f0..589bd900 100644 --- a/src/content/dependencies/generateAlbumSidebarTrackSection.js +++ b/src/content/dependencies/generateAlbumSidebarTrackSection.js @@ -70,17 +70,14 @@ export default { const trackListItems = relations.trackLinks.map((trackLink, index) => html.tag('li', - { - class: [ - data.includesCurrentTrack && - index === data.currentTrackIndex && - 'current', - - slots.mode === 'commentary' && - data.tracksAreMissingCommentary[index] && - 'no-commentary', - ], - }, + data.includesCurrentTrack && + index === data.currentTrackIndex && + {class: 'current'}, + + slots.mode === 'commentary' && + data.tracksAreMissingCommentary[index] && + {class: 'no-commentary'}, + language.$('albumSidebar.trackList.item', { track: (slots.mode === 'commentary' && data.tracksAreMissingCommentary[index] @@ -96,24 +93,24 @@ export default { }))); return html.tag('details', - { - class: data.includesCurrentTrack && 'current', - - open: ( - // Allow forcing open via a template slot. - // This isn't exactly janky, but the rest of this function - // kind of is when you contextualize it in a template... - slots.open || - - // Leave sidebar track sections collapsed on album info page, - // since there's already a view of the full track listing - // in the main content area. - data.isTrackPage && - - // Only expand the track section which includes the track - // currently being viewed by default. - data.includesCurrentTrack), - }, + data.includesCurrentTrack && + {class: 'current'}, + + {open: + // Allow forcing open via a template slot. + // This isn't exactly janky, but the rest of this function + // kind of is when you contextualize it in a template... + slots.open || + + // Leave sidebar track sections collapsed on album info page, + // since there's already a view of the full track listing + // in the main content area. + data.isTrackPage && + + // Only expand the track section which includes the track + // currently being viewed by default. + data.includesCurrentTrack}, + [ html.tag('summary', {style}, html.tag('span', -- cgit 1.3.0-6-gf8a5