Created
February 27, 2014 14:27
-
-
Save vyahhi/9251106 to your computer and use it in GitHub Desktop.
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
## | |
## begin of Fullscreen + History API fix based on http://stackoverflow.com/a/21963459/92396 | |
## | |
fixed_location = null | |
class Em.FixedHistoryLocation extends Em.HistoryLocation | |
implementation: 'history-fullscreen' | |
pathQueue = [] | |
init: -> | |
fixed_location = this | |
super | |
pushState: (path)-> | |
if screenfull.isFullscreen | |
pathQueue.push(path) | |
else | |
super path | |
fireQueue: ()-> | |
for path in pathQueue then do (path) => | |
this.pushState(path) | |
pathQueue = [] | |
App.register 'location:history-fullscreen', Em.FixedHistoryLocation # for App.Router.reopen | |
document.addEventListener screenfull.raw.fullscreenchange, -> | |
if not screenfull.isFullscreen | |
fixed_location.fireQueue() | |
## | |
## end of Fullscreen + History API fix | |
## | |
App.Router.reopen | |
location: 'history-fullscreen' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment