diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-10-12 10:14:33 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-10-12 10:14:33 +0900 |
commit | 003742ec51aa7aea9214442bc0b611e2eb5eaf6e (patch) | |
tree | 20345e48bd226c1e83a1145721f7ba585a1452aa /src/content/components | |
parent | 6e6e306275a8ee5632a22b1e30c807bd5ae9cc7e (diff) |
Support global marks which select a tab
Diffstat (limited to 'src/content/components')
-rw-r--r-- | src/content/components/common/mark.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/content/components/common/mark.js b/src/content/components/common/mark.js index 06b2657..ce35afa 100644 --- a/src/content/components/common/mark.js +++ b/src/content/components/common/mark.js @@ -30,8 +30,10 @@ export default class MarkComponent { if (key.ctrlKey || key.metaKey || key.altKey) { consoleFrames.postError(window.document, 'Unknown mark'); - } else if (key.shiftKey) { - consoleFrames.postError(window.document, 'Globa marks not supported'); + } else if (key.shiftKey && markStage.setMode) { + this.doSetGlobal(key); + } else if (key.shiftKey && markStage.jumpMode) { + this.doJumpGlobal(key); } else if (markStage.setMode) { this.doSet(key); } else if (markStage.jumpMode) { @@ -56,4 +58,13 @@ export default class MarkComponent { let { x, y } = marks[key.key]; scrolls.scrollTo(x, y, smoothscroll); } + + doSetGlobal(key) { + let { x, y } = scrolls.getScroll(); + this.store.dispatch(markActions.setGlobal(key.key, x, y)); + } + + doJumpGlobal(key) { + this.store.dispatch(markActions.jumpGlobal(key.key)); + } } |