public
Created

Fix to allow SC.routes to set a currentLocation without triggering routing.

  • Download Gist
routes_hack.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13
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);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.