Skip to content

Commit fcffc8c

Browse files
authored
Merge pull request #1 from collbox/master
Replace (IE-incompatible) use of Element.closest
2 parents ce02504 + e0bee61 commit fcffc8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pushy/core.cljs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(ns pushy.core
2-
(:require [goog.events :as events]
2+
(:require [goog.dom :as dom]
3+
[goog.events :as events]
34
[clojure.string])
45
(:import goog.History
56
goog.history.Html5History
@@ -97,7 +98,7 @@
9798
(swap! event-keys conj
9899
(on-click
99100
(fn [e]
100-
(when-let [el (some-> e .-target (.closest "a"))]
101+
(when-let [el (some-> e .-target (dom/getAncestorByTagNameAndClass "a" nil nil))]
101102
(let [uri (.parse Uri (.-href el))]
102103
;; Proceed if `identity-fn` returns a value and
103104
;; the user did not trigger the event via one of the

0 commit comments

Comments
 (0)