Merge pull request #634 from wojciechka/master

Allow handling of back/forward buttons in browser when running with prefix (i.e. as /discourse)
This commit is contained in:
Robin Ward 2013-04-03 08:11:53 -07:00
commit 59e4e77190
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);
}