()
| 1005 | const serviceContainer = document.createElement("div"); |
| 1006 | |
| 1007 | function stackServiceElements() { |
| 1008 | userConfigs.servicesOrder.forEach((name, index) => { |
| 1009 | const el = userConfigs.services[name].element; |
| 1010 | |
| 1011 | const [up, down] = el.querySelectorAll("button"); |
| 1012 | if (index === 0) { |
| 1013 | up.disabled = true; |
| 1014 | down.disabled = false; |
| 1015 | } else if (index === userConfigs.servicesOrder.length - 1) { |
| 1016 | up.disabled = false; |
| 1017 | down.disabled = true; |
| 1018 | } else { |
| 1019 | up.disabled = false; |
| 1020 | down.disabled = false; |
| 1021 | } |
| 1022 | |
| 1023 | serviceContainer.append(el); |
| 1024 | }); |
| 1025 | } |
| 1026 | |
| 1027 | function switchCallback(el, state) { |
| 1028 | const id = el.dataset.id; |
no outgoing calls
no test coverage detected