Skip to content

Instantly share code, notes, and snippets.

@GauravShetty1016
Created May 26, 2012 12:34
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 GauravShetty1016/2793789 to your computer and use it in GitHub Desktop.
Save GauravShetty1016/2793789 to your computer and use it in GitHub Desktop.
Workaround for the Ember router browser buttons issue
Ember.Application.reopen({
setupStateManager: function(stateManager) {
var location = Ember.get(stateManager, 'location');
if (typeof location === 'string') {
location = Ember.Location.create({implementation: location});
Ember.set(stateManager, 'location', location);
}
stateManager.route(location.getURL());
location.onUpdateURL(function(url) {
stateManager.transitionTo('root');
stateManager.route(url);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment