aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PreviewCursor.tsx
diff options
context:
space:
mode:
authorMelissa Zhang <mzhang19096@gmail.com>2020-04-22 23:40:32 -0700
committerMelissa Zhang <mzhang19096@gmail.com>2020-04-22 23:40:32 -0700
commit4f3964ecaa67797237734deb4b2ae9aaaf77a940 (patch)
tree04460478d173f56d3f2950fcf001ab63e000a9b8 /src/client/views/PreviewCursor.tsx
parent13f182c2f138c25b0b57169dc94ecbfdd59483ef (diff)
parentd2682eba642d2f10e94822d9c9864a6477052e06 (diff)
fixed merge conflicts
Diffstat (limited to 'src/client/views/PreviewCursor.tsx')
-rw-r--r--src/client/views/PreviewCursor.tsx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/client/views/PreviewCursor.tsx b/src/client/views/PreviewCursor.tsx
index ecebadd2a..df30c1215 100644
--- a/src/client/views/PreviewCursor.tsx
+++ b/src/client/views/PreviewCursor.tsx
@@ -13,7 +13,7 @@ export class PreviewCursor extends React.Component<{}> {
static _getTransform: () => Transform;
static _addLiveTextDoc: (doc: Doc) => void;
static _addDocument: (doc: Doc) => boolean;
- static _nudge: (x: number, y: number) => void;
+ static _nudge: (x: number, y: number) => boolean;
@observable static _clickPoint = [0, 0];
@observable public static Visible = false;
constructor(props: any) {
@@ -91,17 +91,13 @@ export class PreviewCursor extends React.Component<{}> {
}
} else if (PreviewCursor.Visible) {
if (e.key === "ArrowRight") {
- PreviewCursor._nudge?.(1 * (e.shiftKey ? 2 : 1), 0);
- e.stopPropagation();
+ PreviewCursor._nudge?.(1 * (e.shiftKey ? 2 : 1), 0) && e.stopPropagation();
} else if (e.key === "ArrowLeft") {
- PreviewCursor._nudge?.(-1 * (e.shiftKey ? 2 : 1), 0);
- e.stopPropagation();
+ PreviewCursor._nudge?.(-1 * (e.shiftKey ? 2 : 1), 0) && e.stopPropagation();
} else if (e.key === "ArrowUp") {
- PreviewCursor._nudge?.(0, 1 * (e.shiftKey ? 2 : 1));
- e.stopPropagation();
+ PreviewCursor._nudge?.(0, 1 * (e.shiftKey ? 2 : 1)) && e.stopPropagation();
} else if (e.key === "ArrowDown") {
- PreviewCursor._nudge?.(0, -1 * (e.shiftKey ? 2 : 1));
- e.stopPropagation();
+ PreviewCursor._nudge?.(0, -1 * (e.shiftKey ? 2 : 1)) && e.stopPropagation();
}
}
}
@@ -117,7 +113,7 @@ export class PreviewCursor extends React.Component<{}> {
addLiveText: (doc: Doc) => void,
getTransform: () => Transform,
addDocument: (doc: Doc) => boolean,
- nudge: (nudgeX: number, nudgeY: number) => void) {
+ nudge: (nudgeX: number, nudgeY: number) => boolean) {
this._clickPoint = [x, y];
this._onKeyPress = onKeyPress;
this._addLiveTextDoc = addLiveText;