Skip to content

Commit f4d1e06

Browse files
authored
Merge pull request #8490 from filipesilva/button-card-preview
fix: show card preview on button hover too
2 parents b89e1ec + 94e07c5 commit f4d1e06

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/cljs/nr/gameboard/card_preview.cljs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55
(defonce zoom-channel (chan))
66

7+
(defn- safe-get-attribute [target attribute]
8+
(when (.-getAttribute target)
9+
(.getAttribute target attribute)))
10+
711
(defn- get-card-data-title [e]
812
(let [target (.. e -target)
9-
title (.getAttribute target "data-card-title")]
13+
title (or (safe-get-attribute target "data-card-title")
14+
(when (= "BUTTON" (.-tagName target))
15+
(some-> target .-firstChild (safe-get-attribute "data-card-title"))))]
1016
(not-empty title)))
1117

1218
(defn put-game-card-in-channel

0 commit comments

Comments
 (0)