diff --git a/shared/static/wasm/sx/dom.sx b/shared/static/wasm/sx/dom.sx index 32849936..91de4888 100644 --- a/shared/static/wasm/sx/dom.sx +++ b/shared/static/wasm/sx/dom.sx @@ -261,12 +261,28 @@ dom-add-class (fn (el cls) - (when el (host-call (host-get el "classList") "add" cls)))) + (cond + ((nil? el) nil) + ((list? el) + (for-each + (fn + (x) + (when x (host-call (host-get x "classList") "add" cls))) + el)) + (true (host-call (host-get el "classList") "add" cls))))) (define dom-remove-class (fn (el cls) - (when el (host-call (host-get el "classList") "remove" cls)))) + (cond + ((nil? el) nil) + ((list? el) + (for-each + (fn + (x) + (when x (host-call (host-get x "classList") "remove" cls))) + el)) + (true (host-call (host-get el "classList") "remove" cls))))) (define dom-has-class? (fn