Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 03e9359

Browse files
committed
Moved history overriding functions from main.js to router.js
1 parent ea812f0 commit 03e9359

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

js/main.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,3 @@ heartbeat.on('message', function(e) {
497497
}
498498
}
499499
});
500-
501-
var originalHistoryBack = history.back;
502-
history.back = function() {
503-
historyAction = 'back';
504-
originalHistoryBack();
505-
}
506-
507-
var originalHistoryForward = history.forward;
508-
history.forward = function() {
509-
historyAction = 'forward';
510-
originalHistoryForward();
511-
}

js/router.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ module.exports = Backbone.Router.extend({
4848
this.navigate(translatedRoute, { trigger: true });
4949
});
5050
});
51+
52+
var originalHistoryBack = history.back;
53+
history.back = function() {
54+
historyAction = 'back';
55+
originalHistoryBack();
56+
}
57+
58+
var originalHistoryForward = history.forward;
59+
history.forward = function() {
60+
historyAction = 'forward';
61+
originalHistoryForward();
62+
}
63+
5164
window.historySize = -1;
5265
window.historyPosition = -1;
5366
window.historyAction = 'default';

0 commit comments

Comments
 (0)