2016-06-30 13:21:47 +03:00
|
|
|
import HistoryLocation from 'ember-locations/history';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
let trailingHistory = HistoryLocation.extend({
|
|
|
|
formatURL() {
|
2016-04-28 14:41:23 +03:00
|
|
|
let url = this._super(...arguments);
|
|
|
|
|
|
|
|
if (url.indexOf('?') > 0) {
|
|
|
|
return url.replace(/([^\/])\?/, '$1/?');
|
|
|
|
} else {
|
|
|
|
return url.replace(/\/?$/, '/');
|
|
|
|
}
|
2014-05-14 05:52:31 +04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-08-19 14:55:40 +03:00
|
|
|
export default {
|
2014-05-14 05:52:31 +04:00
|
|
|
name: 'registerTrailingLocationHistory',
|
|
|
|
|
2015-11-30 21:23:47 +03:00
|
|
|
initialize(application) {
|
2014-05-14 05:52:31 +04:00
|
|
|
application.register('location:trailing-history', trailingHistory);
|
|
|
|
}
|
|
|
|
};
|