Skip to content

Instantly share code, notes, and snippets.

@stephenway
Created January 31, 2017 16:31
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 stephenway/f43be9ce6de834f8f6866dd89adeb41c to your computer and use it in GitHub Desktop.
Save stephenway/f43be9ce6de834f8f6866dd89adeb41c to your computer and use it in GitHub Desktop.
Clojurescript Fullscreen Button
(defn get-canvas []
"Returns canvas that will be fullscreened after a click."
(let [canvas (.getElementById js/document "article")
btnStatusBoard (.getElementById js/document "btnStatusBoard")]
(when canvas (.addEventListener btnStatusBoard "click" #(.webkitRequestFullscreen canvas)))
canvas))
(dom/button #js {:className "c-button c-button--text"
:id "btnStatusBoard"
:title (tr "Fullscreen")}
(uic/icon :fullscreen) (tr "Fullscreen"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment