diff --git a/src/looped_in/content.cljs b/src/looped_in/content.cljs index 1d3d71b..d5bb649 100644 --- a/src/looped_in/content.cljs +++ b/src/looped_in/content.cljs @@ -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))) diff --git a/src/looped_in/sidebar.cljs b/src/looped_in/sidebar.cljs index 29a8a43..dad749d 100644 --- a/src/looped_in/sidebar.cljs +++ b/src/looped_in/sidebar.cljs @@ -224,10 +224,7 @@ (dom/append $container $sidebar-dom)))) (defn handle-close-button [e] - (go (-> (analytics/log-event "CLOSED_SIDEBAR") - (js {:type "closeSidebar"}) "*")))))) + (.postMessage js/window.parent (clj->js {:type "closeSidebar"}) "*")) (defn handle-events "Registers event listeners"