From aa9db35cfe91efef0dc797324b5570fd2245d66a Mon Sep 17 00:00:00 2001 From: David Arvelo Date: Sun, 15 Jun 2014 16:54:58 -0400 Subject: [PATCH] Fix trailing slashes output app-wide closes #2963, closes #2964 - override Ember's `HistoryLocation.formatURL` - remove overridden `HistoryLocation.setURL` --- ghost/admin/initializers/trailing-history.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ghost/admin/initializers/trailing-history.js b/ghost/admin/initializers/trailing-history.js index 89c9840940..50b4a67e38 100644 --- a/ghost/admin/initializers/trailing-history.js +++ b/ghost/admin/initializers/trailing-history.js @@ -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(/\/?$/, '/'); } });