🐛 Fix header not showing when exiting fullscreen mode in viewer

This commit is contained in:
alonso.torres 2023-03-23 10:48:31 +01:00
parent eedb83e863
commit 020454e701
4 changed files with 39 additions and 5 deletions

View file

@ -368,12 +368,22 @@
(when (some? node)
(.blur node)))
;; List of dom events for different browsers to detect the exit of fullscreen mode
(def fullscreen-events
["fullscreenchange" "mozfullscreenchange" "MSFullscreenChange" "webkitfullscreenchange"])
(defn fullscreen?
[]
(cond
(obj/in? globals/document "webkitFullscreenElement")
(boolean (.-webkitFullscreenElement globals/document))
(obj/in? globals/document "mozFullScreen")
(boolean (.-mozFullScreen globals/document))
(obj/in? globals/document "msFullscreenElement")
(boolean (.-msFullscreenElement globals/document))
(obj/in? globals/document "fullscreenElement")
(boolean (.-fullscreenElement globals/document))