aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-02-16 19:12:11 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-02-16 19:12:11 -0500
commit70a8b4ab8075af4d06efb04c083b3bf11636373e (patch)
tree50abb55e5e17b00a13773fe3ba6c3de51c5c8052 /src/Utils.ts
parent3c71a4b9c727f8eee8631b46b28c010682608f13 (diff)
Fixed issues with Document updates and changed how FieldView layout string works
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index ce4f7ac3e..c9c006aa8 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -31,6 +31,18 @@ export class Utils {
return { scale, translateX, translateY };
}
+ public static CopyText(text: string) {
+ var textArea = document.createElement("textarea");
+ textArea.value = text;
+ document.body.appendChild(textArea);
+ textArea.focus();
+ textArea.select();
+
+ try { document.execCommand('copy'); } catch (err) { }
+
+ document.body.removeChild(textArea);
+ }
+
public static Emit<T>(socket: Socket | SocketIOClient.Socket, message: Message<T>, args: T) {
socket.emit(message.Message, args);
}