aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/display-frame.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-31 21:48:10 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-31 21:48:10 -0700
commit405e487a7347181f6f49f01839c807c84fc93e41 (patch)
tree2b5d055398e525d608b549d67b0b918b0ccba0ab /ext/fg/js/display-frame.js
parent1d9e911648c35a65ea706fa362515ae55958000d (diff)
ctrl + c to copy
Diffstat (limited to 'ext/fg/js/display-frame.js')
-rw-r--r--ext/fg/js/display-frame.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/fg/js/display-frame.js b/ext/fg/js/display-frame.js
index 59032d0c..f6f7683e 100644
--- a/ext/fg/js/display-frame.js
+++ b/ext/fg/js/display-frame.js
@@ -51,6 +51,10 @@ window.displayFrame = new class extends Display {
window.parent.postMessage('popupClose', '*');
}
+ selectionCopy() {
+ window.parent.postMessage('selectionCopy', '*');
+ }
+
showOrphaned() {
$('#content').hide();
$('#orphan').show();
@@ -77,4 +81,27 @@ window.displayFrame = new class extends Display {
handler(params);
}
}
+
+ onKeyDown(e) {
+ if (super.onKeyDown(e)) {
+ return true;
+ }
+
+ const handlers = {
+ 67: /* c */ () => {
+ if (e.ctrlKey) {
+ this.selectionCopy();
+ return true;
+ }
+ }
+ };
+
+ const handler = handlers[e.keyCode];
+ if (handler && handler()) {
+ e.preventDefault();
+ return true;
+ }
+
+ return false;
+ }
};