Skip to content

Instantly share code, notes, and snippets.

@sgrove
Created November 24, 2012 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgrove/ad13e5d068b32a6349c3 to your computer and use it in GitHub Desktop.
Save sgrove/ad13e5d068b32a6349c3 to your computer and use it in GitHub Desktop.
(ns zenbox.main
(:require ...))
(def controls (atom []))
(defn build-drop-down-menu [menu-node service menu-data]
"Given a root dom element MENU-NODE, will render template named \"menus/{{service}}_menu\" with supplied MENU-DATA, create a document fragment and append it to MENU-NODE. Finally, it takes care of turning MENU-NODE into a drop-down menu"
(let [menu-button (goog.ui.MenuButton.)]
(swap! controls into [menu-button])))
(defn destroy-widget! []
(map #(do (.exitDocument %) (.dispose %)) @controls)
; reset/empty controls
(swap! controls (fn [& args] []))
(.log js/console "post-Controls:")
(.log js/console @controls))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment