Ghost/ghost/admin/app/initializers/trailing-history.js

22 lines
517 B
JavaScript
Raw Normal View History

import HistoryLocation from 'ember-locations/history';
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 21:23:47 +03:00
initialize(application) {
application.register('location:trailing-history', trailingHistory);
}
};