mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fix trailing slashes output app-wide
closes #2963, closes #2964 - override Ember's `HistoryLocation.formatURL` - remove overridden `HistoryLocation.setURL`
This commit is contained in:
parent
7412493575
commit
aa9db35cfe
1 changed files with 2 additions and 8 deletions
|
@ -1,14 +1,8 @@
|
||||||
/*global Ember */
|
/*global Ember */
|
||||||
|
|
||||||
var trailingHistory = Ember.HistoryLocation.extend({
|
var trailingHistory = Ember.HistoryLocation.extend({
|
||||||
setURL: function (path) {
|
formatURL: function () {
|
||||||
var state = this.getState();
|
return this._super.apply(this, arguments).replace(/\/?$/, '/');
|
||||||
path = this.formatURL(path);
|
|
||||||
path = path.replace(/\/?$/, '/');
|
|
||||||
|
|
||||||
if (state && state.path !== path) {
|
|
||||||
this.pushState(path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue