aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2019-08-14 18:27:45 -0400
committermonikahedman <monika_hedman@brown.edu>2019-08-14 18:27:45 -0400
commitdce7e2d39ffb9dfe2b3847af50a0e50be7eb87c5 (patch)
tree06808dd4908107e70f9995d2d8ccd96bf84cc656 /src
parent81100809b0f824cfc1481b19dbe38c31814539e1 (diff)
yeet we love text
Diffstat (limited to 'src')
-rw-r--r--src/client/views/GlobalKeyHandler.ts8
-rw-r--r--src/client/views/MainOverlayTextBox.tsx3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index e773014e3..f55953bd4 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -181,6 +181,8 @@ export default class KeyManager {
break;
case "a":
case "v":
+ this.printClipboard();
+ break;
case "x":
case "c":
stopPropagation = false;
@@ -194,6 +196,12 @@ export default class KeyManager {
};
});
+ async printClipboard() {
+ let text: string = await navigator.clipboard.readText();
+ console.log(text)
+ console.log(document.activeElement)
+ }
+
private ctrl_shift = action((keyname: string) => {
let stopPropagation = true;
let preventDefault = true;
diff --git a/src/client/views/MainOverlayTextBox.tsx b/src/client/views/MainOverlayTextBox.tsx
index 0f20dc3a8..846f1d8aa 100644
--- a/src/client/views/MainOverlayTextBox.tsx
+++ b/src/client/views/MainOverlayTextBox.tsx
@@ -60,17 +60,20 @@ export class MainOverlayTextBox extends React.Component<MainOverlayTextBoxProps>
return new Transform(-sxf.translateX, -sxf.translateY, 1 / sxf.scale);
};
this.setTextDoc(box.props.fieldKey, box.CurrentDiv, xf, BoolCast(box.props.Document.autoHeight, false) || box.props.height === "min-content");
+ console.log("makin text doc?")
}
else {
this.TextDoc = undefined;
this.TextDataDoc = undefined;
this.setTextDoc();
+ console.log("deletin text doc?")
}
});
}
@action
private setTextDoc(textFieldKey?: string, div?: HTMLDivElement, tx?: () => Transform, autoHeight?: boolean) {
+ console.log("what is going on")
if (this._textTargetDiv) {
this._textTargetDiv.style.color = this._textColor;
}