(el, className)
| 1 | export function toggleClass(el, className){ |
| 2 | if (el && el instanceof Node && className) { |
| 3 | let str = el.className; |
| 4 | const index = str.indexOf(className); |
| 5 | el.className = index === -1 ? |
| 6 | `${str} ${className}` |
| 7 | : str.slice(0, index) + str.slice(index, className.length); |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | export function removeClass(el, className){ |
| 12 | if (!el || !className) return; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…