Skip to content

Instantly share code, notes, and snippets.

@ajchemist
Created May 3, 2015 09:26
Show Gist options
  • Select an option

  • Save ajchemist/1ad35ac77b8481e2f6ea to your computer and use it in GitHub Desktop.

Select an option

Save ajchemist/1ad35ac77b8481e2f6ea to your computer and use it in GitHub Desktop.
(defn listen-cigarette-burn []
(if-let [cigaburn-dom (dom/getElement "cigarette-burn")]
(events/listen
cigaburn-dom
EventType.MOUSEMOVE
(fn [_]
(if-let [noticenter-dom (dom/getElement "notification-center")]
(when-not (classes/has noticenter-dom "reveal")
(classes/addRemove noticenter-dom "unreveal" "reveal")
;; (events/listenOnce
;; noticenter-dom
;; EventType.MOUSELEAVE
;; (fn [e] (classes/remove noticenter-dom "reveal")))
(events/listenOnce
js/document
EventType.CLICK
(fn [e] (classes/addRemove noticenter-dom "reveal" "unreveal"))))
;; notification-center component
(put-state! :notification-center true))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment