« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateAlbumSidebarTrackSection.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateAlbumSidebarTrackSection.js')
-rw-r--r--src/content/dependencies/generateAlbumSidebarTrackSection.js55
1 files changed, 26 insertions, 29 deletions
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',