support history navigation
This commit is contained in:
parent
eec7973060
commit
1afbde6e19
4 changed files with 23 additions and 2 deletions
8
src/content/histories.js
Normal file
8
src/content/histories.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
const prev = (win) => {
|
||||
win.history.back()
|
||||
};
|
||||
const next = (win) => {
|
||||
win.history.forward()
|
||||
};
|
||||
|
||||
export { prev, next };
|
|
@ -1,7 +1,8 @@
|
|||
import * as scrolls from './scrolls';
|
||||
import * as histories from './histories';
|
||||
import * as actions from '../shared/actions';
|
||||
import FooterLine from './footer-line';
|
||||
import Follow from './follow';
|
||||
import * as actions from '../shared/actions';
|
||||
|
||||
var footer = null;
|
||||
|
||||
|
@ -56,6 +57,12 @@ const invokeEvent = (action) => {
|
|||
case actions.FOLLOW_START:
|
||||
new Follow(window.document, action[1] || false);
|
||||
break;
|
||||
case actions.HISTORY_PREV:
|
||||
histories.prev(window);
|
||||
break;
|
||||
case actions.HISTORY_NEXT:
|
||||
histories.next(window);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue