rename history navigation
This commit is contained in:
parent
ae317113e7
commit
aeb0e0f96d
5 changed files with 17 additions and 17 deletions
|
@ -28,8 +28,8 @@ const defaultKeymap = {
|
||||||
'zz': { type: operations.ZOOM_NEUTRAL },
|
'zz': { type: operations.ZOOM_NEUTRAL },
|
||||||
'f': { type: operations.FOLLOW_START, newTab: false },
|
'f': { type: operations.FOLLOW_START, newTab: false },
|
||||||
'F': { type: operations.FOLLOW_START, newTab: true },
|
'F': { type: operations.FOLLOW_START, newTab: true },
|
||||||
'H': { type: operations.HISTORY_PREV },
|
'H': { type: operations.NAVIGATE_HISTORY_PREV },
|
||||||
'L': { type: operations.HISTORY_NEXT },
|
'L': { type: operations.NAVIGATE_HISTORY_NEXT },
|
||||||
};
|
};
|
||||||
|
|
||||||
const asKeymapChars = (keys) => {
|
const asKeymapChars = (keys) => {
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
const prev = (win) => {
|
|
||||||
win.history.back();
|
|
||||||
};
|
|
||||||
const next = (win) => {
|
|
||||||
win.history.forward();
|
|
||||||
};
|
|
||||||
|
|
||||||
export { prev, next };
|
|
|
@ -1,7 +1,7 @@
|
||||||
import '../console/console-frame.scss';
|
import '../console/console-frame.scss';
|
||||||
import * as consoleFrames from '../console/frames';
|
import * as consoleFrames from '../console/frames';
|
||||||
import * as scrolls from '../content/scrolls';
|
import * as scrolls from '../content/scrolls';
|
||||||
import * as histories from '../content/histories';
|
import * as navigates from '../content/navigates';
|
||||||
import Follow from '../content/follow';
|
import Follow from '../content/follow';
|
||||||
import operations from '../operations';
|
import operations from '../operations';
|
||||||
import messages from '../messages';
|
import messages from '../messages';
|
||||||
|
@ -35,10 +35,10 @@ const execOperation = (operation) => {
|
||||||
return scrolls.scrollRight(window);
|
return scrolls.scrollRight(window);
|
||||||
case operations.FOLLOW_START:
|
case operations.FOLLOW_START:
|
||||||
return new Follow(window.document, operation.newTab);
|
return new Follow(window.document, operation.newTab);
|
||||||
case operations.HISTORY_PREV:
|
case operations.NAVIGATE_HISTORY_PREV:
|
||||||
return histories.prev(window);
|
return navigates.historyPrev(window);
|
||||||
case operations.HISTORY_NEXT:
|
case operations.NAVIGATE_HISTORY_NEXT:
|
||||||
return histories.next(window);
|
return navigates.historyNext(window);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
8
src/content/navigates.js
Normal file
8
src/content/navigates.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
const historyPrev = (win) => {
|
||||||
|
win.history.back();
|
||||||
|
};
|
||||||
|
const historyNext = (win) => {
|
||||||
|
win.history.forward();
|
||||||
|
};
|
||||||
|
|
||||||
|
export { historyPrev, historyNext };
|
|
@ -11,8 +11,8 @@ export default {
|
||||||
SCROLL_LEFT: 'scroll.left',
|
SCROLL_LEFT: 'scroll.left',
|
||||||
SCROLL_RIGHT: 'scroll.right',
|
SCROLL_RIGHT: 'scroll.right',
|
||||||
FOLLOW_START: 'follow.start',
|
FOLLOW_START: 'follow.start',
|
||||||
HISTORY_PREV: 'history.prev',
|
NAVIGATE_HISTORY_PREV: 'navigate.history.prev',
|
||||||
HISTORY_NEXT: 'history.next',
|
NAVIGATE_HISTORY_NEXT: 'navigate.history.next',
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
TABS_CLOSE: 'tabs.close',
|
TABS_CLOSE: 'tabs.close',
|
||||||
|
|
Reference in a new issue