aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-09 21:11:18 -0500
committerbobzel <zzzman@gmail.com>2021-03-09 21:11:18 -0500
commit5fd9a0d6285d425363f820426d447343bc54f518 (patch)
treea3d420edd9740d61e44fcd4f233456ad1c7d4571 /src
parent9e04c57cab8095277398cbcee6fa4ebd904dcf85 (diff)
from last
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 89df7a98a..ad11d55bf 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -91,16 +91,13 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
return Cast(Doc.UserDoc().defaultTextLayout, Doc, null) || StrCast(Doc.UserDoc().defaultTextLayout, null);
}
public static Instance: FormattedTextBox;
+ public static LiveTextUndo: UndoManager.Batch | undefined;
static _highlights: string[] = ["Audio Tags", "Text from Others", "Todo Items", "Important Items", "Disagree Items", "Ignore Items"];
static _highlightStyleSheet: any = addStyleSheet();
static _bulletStyleSheet: any = addStyleSheet();
static _userStyleSheet: any = addStyleSheet();
static _canAnnotate = true;
static _hadSelection: boolean = false;
- public static LiveTextUndo: UndoManager.Batch | undefined;
- public ProseRef?: HTMLDivElement;
- public get EditorView() { return this._editorView; }
- public get SidebarKey() { return this.fieldKey + "-sidebar"; }
private _ref: React.RefObject<HTMLDivElement> = React.createRef();
private _scrollRef: React.RefObject<HTMLDivElement> = React.createRef();
private _editorView: Opt<EditorView>;
@@ -123,6 +120,9 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
private _downX = 0;
private _downY = 0;
private _break = false;
+ public ProseRef?: HTMLDivElement;
+ public get EditorView() { return this._editorView; }
+ public get SidebarKey() { return this.fieldKey + "-sidebar"; }
@computed get sidebarWidthPercent() { return StrCast(this.layoutDoc._sidebarWidthPercent, "0%"); }
@computed get sidebarColor() { return StrCast(this.layoutDoc.sidebarColor, StrCast(this.layoutDoc[this.props.fieldKey + "-backgroundColor"], "#e4e4e4")); }
@@ -879,14 +879,11 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
}
};
const undo = () => {
- if (!exportState) {
- return;
- }
- const content: GoogleApiClientUtils.Docs.Content = {
- text: exportState.text,
- requests: []
- };
- if (reference && content) {
+ if (exportState && reference) {
+ const content: GoogleApiClientUtils.Docs.Content = {
+ text: exportState.text,
+ requests: []
+ };
GoogleApiClientUtils.Docs.write({ reference, content, mode });
}
};