Created
October 21, 2010 16:24
-
-
Save wagenet/638803 to your computer and use it in GitHub Desktop.
Fix to allow SC.routes to set a currentLocation without triggering routing.
This file contains 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
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