MCPcopy Index your code
hub / github.com/spicetify/cli / stackServiceElements

Function stackServiceElements

CustomApps/reddit/Settings.js:25–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 const serviceContainer = document.createElement("div");
24
25 function stackServiceElements() {
26 CONFIG.services.forEach((name, index) => {
27 const el = CONFIG.servicesElement[name];
28
29 const [up, down] = el.querySelectorAll("button");
30 if (CONFIG.services.length === 1) {
31 up.disabled = true;
32 down.disabled = true;
33 } else if (index === 0) {
34 up.disabled = true;
35 down.disabled = false;
36 } else if (index === CONFIG.services.length - 1) {
37 up.disabled = false;
38 down.disabled = true;
39 } else {
40 up.disabled = false;
41 down.disabled = false;
42 }
43
44 serviceContainer.append(el);
45 });
46 gridUpdateTabs?.();
47 }
48
49 function posCallback(el, dir) {
50 const id = el.dataset.id;

Callers 3

posCallbackFunction · 0.70
removeCallbackFunction · 0.70
openConfigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected