Reworked rootURL in ember.js and allow handling of back/forward buttons in browser

This commit is contained in:
Wojciech Kocjan 2013-04-03 14:10:47 +02:00
parent 814be151c1
commit a0ef917736
1 changed files with 6 additions and 1 deletions

View File

@ -153,7 +153,12 @@ Ember.DiscourseLocation = Ember.Object.extend({
if (e.state) {
var currentState = self.get('currentState');
if (currentState) {
callback(e.state.path);
var url = e.state.path,
rootURL = get(self, 'rootURL');
rootURL = rootURL.replace(/\/$/, '');
url = url.replace(rootURL, '');
callback(url);
} else {
this.set('currentState', e.state);
}