« get me outta code hell

content: generateTrackList{,Item}: colorMode slot - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateTrackListItem.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-10-30 16:03:15 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-10-30 16:03:52 -0300
commite5b2698286232986a31325cefd72467bf19f89a8 (patch)
treeefbbcf26dbc57b58302af16df87ddab5c2ab29b5 /src/content/dependencies/generateTrackListItem.js
parentbffbe2c30a60808c68e34ce3844f8db16e205960 (diff)
content: generateTrackList{,Item}: colorMode slot
Diffstat (limited to 'src/content/dependencies/generateTrackListItem.js')
-rw-r--r--src/content/dependencies/generateTrackListItem.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/content/dependencies/generateTrackListItem.js b/src/content/dependencies/generateTrackListItem.js
index 36e56717..887b6f03 100644
--- a/src/content/dependencies/generateTrackListItem.js
+++ b/src/content/dependencies/generateTrackListItem.js
@@ -50,16 +50,16 @@ export default {
       default: false,
     },
 
-    color: {
-      type: 'boolean',
-      default: true,
+    colorMode: {
+      validate: v => v.is('none', 'track', 'line'),
+      default: 'track',
     },
   },
 
   generate: (data, relations, slots, {html, language}) =>
     language.encapsulate('trackList.item', itemCapsule =>
       html.tag('li',
-        slots.color &&
+        slots.colorMode === 'line' &&
           relations.colorStyle.slot('context', 'primary-only'),
 
         language.encapsulate(itemCapsule, workingCapsule => {
@@ -67,7 +67,7 @@ export default {
 
           workingOptions.track =
             relations.trackLink
-              .slot('color', false);
+              .slot('color', slots.colorMode === 'track');
 
           if (slots.showDuration) {
             workingCapsule += '.withDuration';