mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
23 lines
589 B
JavaScript
23 lines
589 B
JavaScript
|
/*global Ember */
|
||
|
|
||
|
var trailingHistory = Ember.HistoryLocation.extend({
|
||
|
setURL: function (path) {
|
||
|
var state = this.getState();
|
||
|
path = this.formatURL(path);
|
||
|
path = path.replace(/\/?$/, '/');
|
||
|
|
||
|
if (state && state.path !== path) {
|
||
|
this.pushState(path);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
var registerTrailingLocationHistory = {
|
||
|
name: 'registerTrailingLocationHistory',
|
||
|
|
||
|
initialize: function (container, application) {
|
||
|
application.register('location:trailing-history', trailingHistory);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default registerTrailingLocationHistory;
|