(get-parent node class-name)
Returns the nearest parent with the given class name.
Source
(defn
get-parent
"Returns the nearest parent with the given class name."
[node class-name]
(loop
[node node]
(when-let
[parent (.-parentElement node)]
(if
(.contains (.-classList parent) class-name)
parent
(recur parent)))))