Skip to content

Instantly share code, notes, and snippets.

@jacquescrocker
Created March 2, 2014 02:54
Show Gist options
  • Save jacquescrocker/9301184 to your computer and use it in GitHub Desktop.
Save jacquescrocker/9301184 to your computer and use it in GitHub Desktop.
hash_no_back_hack.coffee
# override ember's hashlocation to not do back/forward functionality
Ember.HashLocation.reopen({
setURL: (path) ->
@replaceURL(path)
})
@jacquescrocker
Copy link
Author

well... when you have ember in an iframe (embedded in gmail via chrome extension), you don't want ember to take over the back/forward buttons of the parent window

this hack solves it, in a terrible yes-it-will-break-in-the-future way (it overrides a private api method)

seems like ember needs a router configuration option to enable/disable back/forward. i'll post a feature request but i can't see them thinking my use case is terribly important for them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment