« get me outta code hell

content: generateDotSwitcherTemplate: various dynamics fixes - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-10-19 20:56:00 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-11-02 22:25:45 -0300
commit7af82c0c009d2f2aeb6b242b5ee1bafdee4ffc95 (patch)
treee45c3a1b934ac58af4f941d6067fc79aced7a124 /src/content
parent4ee17a3fc87de8fee776b32854ae5e9cf6b5ef1c (diff)
content: generateDotSwitcherTemplate: various dynamics fixes
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateDotSwitcherTemplate.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/content/dependencies/generateDotSwitcherTemplate.js b/src/content/dependencies/generateDotSwitcherTemplate.js
index 6d350b22..745a1471 100644
--- a/src/content/dependencies/generateDotSwitcherTemplate.js
+++ b/src/content/dependencies/generateDotSwitcherTemplate.js
@@ -1,5 +1,5 @@
 export default {
-  extraDependencies: ['html', 'language'],
+  extraDependencies: ['html'],
 
   slots: {
     attributes: {
@@ -14,16 +14,20 @@ export default {
     initialOptionIndex: {type: 'number'},
   },
 
-  generate: (slots, {html, language}) =>
+  generate: (slots, {html}) =>
     html.tag('span', {class: 'dot-switcher'},
+      {[html.noEdgeWhitespace]: true},
+      {[html.joinChildren]: ''},
+
       slots.attributes,
 
-      language.formatListWithoutSeparator(
-        slots.options
-          .map((option, index) =>
-            html.tag('span',
-              index === slots.initialOptionIndex &&
-                {class: 'current'},
+      slots.options
+        .map((option, index) =>
+          html.tag('span',
+            {[html.onlyIfContent]: true},
+
+            index === slots.initialOptionIndex &&
+              {class: 'current'},
 
-              option)))),
+            option))),
 };