Fix trailing slashes output app-wide

closes #2963, closes #2964
- override Ember's `HistoryLocation.formatURL`
- remove overridden `HistoryLocation.setURL`
This commit is contained in:
David Arvelo 2014-06-15 16:54:58 -04:00
parent 7412493575
commit aa9db35cfe

View File

@ -1,14 +1,8 @@
/*global Ember */
var trailingHistory = Ember.HistoryLocation.extend({
setURL: function (path) {
var state = this.getState();
path = this.formatURL(path);
path = path.replace(/\/?$/, '/');
if (state && state.path !== path) {
this.pushState(path);
}
formatURL: function () {
return this._super.apply(this, arguments).replace(/\/?$/, '/');
}
});