0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/client/app/initializers/trailing-history.js

24 lines
523 B
JavaScript
Raw Normal View History

2015-02-12 21:22:32 -07:00
import Ember from 'ember';
const {HistoryLocation} = Ember;
let trailingHistory = HistoryLocation.extend({
formatURL() {
let url = this._super(...arguments);
if (url.indexOf('?') > 0) {
return url.replace(/([^\/])\?/, '$1/?');
} else {
return url.replace(/\/?$/, '/');
}
}
});
export default {
name: 'registerTrailingLocationHistory',
2015-11-30 12:23:47 -06:00
initialize(application) {
application.register('location:trailing-history', trailingHistory);
}
};