diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-02-26 21:20:13 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-02-26 21:23:21 +0900 |
commit | 8cc7d472dff5882e4379869345667dd4ba53ca45 (patch) | |
tree | 26fe92f786730b4b588a20257902220070d292da /src/content | |
parent | c69fdbb14a3eb60d5cfd4f6d1816732dbc2b9163 (diff) |
Cancel following by <C-[>
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/components/common/follow.js | 1 | ||||
-rw-r--r-- | src/content/components/top-content/follow-controller.js | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/content/components/common/follow.js b/src/content/components/common/follow.js index 42dd897..a8682c5 100644 --- a/src/content/components/common/follow.js +++ b/src/content/components/common/follow.js @@ -63,6 +63,7 @@ export default class Follow { this.win.parent.postMessage(JSON.stringify({ type: messages.FOLLOW_KEY_PRESS, key: key.key, + ctrlKey: key.ctrlKey, }), '*'); return true; } diff --git a/src/content/components/top-content/follow-controller.js b/src/content/components/top-content/follow-controller.js index 1e7f3cd..1b5586b 100644 --- a/src/content/components/top-content/follow-controller.js +++ b/src/content/components/top-content/follow-controller.js @@ -32,7 +32,7 @@ export default class FollowController { case messages.FOLLOW_RESPONSE_COUNT_TARGETS: return this.create(message.count, sender); case messages.FOLLOW_KEY_PRESS: - return this.keyPress(message.key); + return this.keyPress(message.key, message.ctrlKey); } } @@ -69,7 +69,11 @@ export default class FollowController { }); } - keyPress(key) { + keyPress(key, ctrlKey) { + if (key === '[' && ctrlKey) { + this.store.dispatch(followControllerActions.disable()); + return true; + } switch (key) { case 'Enter': this.activate(); |