diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-04-01 11:20:58 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-04-01 11:20:58 -0700 |
commit | f556c95038e2ef9e4d97b4168ce417ba0d74282f (patch) | |
tree | a99fcceebc658524d672a81de252774f8ae5f8bc /ext/fg/js/display-frame.js | |
parent | e62c46c4fc46f777fa64a931beaef18f2bb0bd7f (diff) |
improve ctrl + c behavior
Diffstat (limited to 'ext/fg/js/display-frame.js')
-rw-r--r-- | ext/fg/js/display-frame.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ext/fg/js/display-frame.js b/ext/fg/js/display-frame.js index f6f7683e..9fd09e74 100644 --- a/ext/fg/js/display-frame.js +++ b/ext/fg/js/display-frame.js @@ -83,13 +83,9 @@ window.displayFrame = new class extends Display { } onKeyDown(e) { - if (super.onKeyDown(e)) { - return true; - } - const handlers = { 67: /* c */ () => { - if (e.ctrlKey) { + if (e.ctrlKey && window.getSelection().toString() === '') { this.selectionCopy(); return true; } @@ -99,9 +95,8 @@ window.displayFrame = new class extends Display { const handler = handlers[e.keyCode]; if (handler && handler()) { e.preventDefault(); - return true; + } else { + super.onKeyDown(e); } - - return false; } }; |