mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
22 lines
517 B
JavaScript
22 lines
517 B
JavaScript
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',
|
|
|
|
initialize(application) {
|
|
application.register('location:trailing-history', trailingHistory);
|
|
}
|
|
};
|