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:
commit
59e4e77190
|
@ -153,7 +153,12 @@ Ember.DiscourseLocation = Ember.Object.extend({
|
||||||
if (e.state) {
|
if (e.state) {
|
||||||
var currentState = self.get('currentState');
|
var currentState = self.get('currentState');
|
||||||
if (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 {
|
} else {
|
||||||
this.set('currentState', e.state);
|
this.set('currentState', e.state);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue