Created
January 31, 2017 16:31
-
-
Save stephenway/f43be9ce6de834f8f6866dd89adeb41c to your computer and use it in GitHub Desktop.
Clojurescript Fullscreen Button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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