Log closed sidebar event in content script
This commit is contained in:
parent
242d991b0c
commit
344e8734c1
@ -2,6 +2,7 @@
|
||||
(:require [goog.dom :as dom]
|
||||
[goog.events :as events]
|
||||
[goog.style :as style]
|
||||
[looped-in.analytics :as analytics]
|
||||
[looped-in.logging :as log]))
|
||||
|
||||
(def sidebar-width 300)
|
||||
@ -34,6 +35,7 @@
|
||||
(defn close-sidebar []
|
||||
(let [$html (.-documentElement js/document)
|
||||
$sidebar (dom/getElement "loopedInSidebar")]
|
||||
(analytics/log-event "CLOSED_SIDEBAR")
|
||||
(dom/removeNode $sidebar)
|
||||
(set! (-> $html (.-style) (.-paddingLeft)) @old-html-padding)))
|
||||
|
||||
|
@ -224,10 +224,7 @@
|
||||
(dom/append $container $sidebar-dom))))
|
||||
|
||||
(defn handle-close-button [e]
|
||||
(go (-> (analytics/log-event "CLOSED_SIDEBAR")
|
||||
(<!)
|
||||
((fn [_]
|
||||
(.postMessage js/window.parent (clj->js {:type "closeSidebar"}) "*"))))))
|
||||
(.postMessage js/window.parent (clj->js {:type "closeSidebar"}) "*"))
|
||||
|
||||
(defn handle-events
|
||||
"Registers event listeners"
|
||||
|
Loading…
Reference in New Issue
Block a user