(defn
show-error-message!
"Shows a popup with an error message."
[parent-elem event]
(let
[elem
(.-target event)
x
(.-clientX event)
y
(.-clientY event)
popup
(.createElement js/document "div")]
(set! (.-textContent popup) (-> elem .-dataset .-message))
(set! (.-top (.-style popup)) (str y "px"))
(set! (.-left (.-style popup)) (str x "px"))
(set! (.-className popup) "error-text")
(.appendChild parent-elem popup)))