Create a gist now

Instantly share code, notes, and snippets.

Fix to allow SC.routes to set a currentLocation without triggering routing.
SC.routes.currentLocationDidChange = function(){
this.set('location', this.get('currentLocation'));
};
SC.routes.addObserver('currentLocation', SC.routes, 'currentLocationDidChange');
SC.routes.locationDidChange = function(){
var location = this.get('location'),
current = this.get('currentLocation');
if (location !== current) {
this.trigger();
this.set('currentLocation', location);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment