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