[style*="--pvid: ${pvid}"]

This commit is contained in:
Adrien MALINGREY 2025-05-19 19:15:58 +02:00
parent 341b017c01
commit 30b47dedde

View File

@ -131,12 +131,12 @@ foreach ($interfaces as $interface) {
<script> <script>
function changeColor(pvid, color) { function changeColor(pvid, color) {
for (let i = 0; i < customColors.sheet.cssRules.length; i++) { for (let i = 0; i < customColors.sheet.cssRules.length; i++) {
if (customColors.sheet.cssRules[i].selectorText == `[class*="pvid ${pvid}"], [class*="vlan ${pvid}"]`) { if (customColors.sheet.cssRules[i].selectorText == `[style*="--pvid: ${pvid}"]`) {
customColors.sheet.deleteRule(i) customColors.sheet.deleteRule(i)
break break
} }
} }
customColors.sheet.insertRule(`[class*="pvid ${pvid}"], [class*="vlan ${pvid}"] { background-color: ${color} }`) customColors.sheet.insertRule(`[style*="--pvid: ${pvid}"] { background-color: ${color} }`)
} }
</script> </script>
</body> </body>