aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionMenu.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-07 17:49:20 -0400
committerbobzel <zzzman@gmail.com>2020-10-07 17:49:20 -0400
commit192e23a2ae335a5f0de361eed9a24a5d08547217 (patch)
treedddae20ffb6354ae33ca7757b154e145a0a6ef6e /src/client/views/collections/CollectionMenu.tsx
parente6b8a14e3463ba65a4dac9f1fcfa6323084904d4 (diff)
fixed undoing changes to a textbox's fontsize/family. changed auto-page ref syntax to start with ':'. fixed making text menu appear when clicking on caption & other text boxes.
Diffstat (limited to 'src/client/views/collections/CollectionMenu.tsx')
-rw-r--r--src/client/views/collections/CollectionMenu.tsx45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index 09ff3bb0c..4bdb233c9 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -529,12 +529,7 @@ export class CollectionFreeFormViewChrome extends React.Component<CollectionMenu
}
@computed get selectedDoc() { return this.selectedDocumentView?.rootDoc; }
@computed get isText() {
- if (this.selectedDoc) {
- const layoutField = Doc.LayoutField(this.selectedDoc);
- const layoutStr = this.selectedDocumentView?.props.LayoutTemplateString || StrCast(layoutField);
- return (document.activeElement as any)?.className.includes("ProseMirror") || layoutStr.includes("FormattedText") || StrCast((layoutField as Doc)?.layout).includes("FormattedText");
- }
- else return false;
+ return this.selectedDoc?.type === DocumentType.RTF || RichTextMenu.Instance?.view ? true : false;
}
@undoBatch
@@ -843,22 +838,26 @@ export class CollectionFreeFormViewChrome extends React.Component<CollectionMenu
render() {
return !this.props.docView.layoutDoc ? (null) :
<div className="collectionFreeFormMenu-cont">
- {!Doc.UserDoc().noviceMode && !this.isText && !this.props.isDoc ? <Tooltip key="back" title={<div className="dash-tooltip">Back Frame</div>} placement="bottom">
- <div className="backKeyframe" onClick={this.prevKeyframe}>
- <FontAwesomeIcon icon={"caret-left"} size={"lg"} />
- </div>
- </Tooltip> : null}
- {!Doc.UserDoc().noviceMode && !this.isText && !this.props.isDoc ? <Tooltip key="num" title={<div className="dash-tooltip">Toggle View All</div>} placement="bottom">
- <div className="numKeyframe" style={{ color: this.document.editing ? "white" : "black", backgroundColor: this.document.editing ? "#5B9FDD" : "#AEDDF8" }}
- onClick={action(() => this.document.editing = !this.document.editing)} >
- {NumCast(this.document._currentFrame)}
- </div>
- </Tooltip> : null}
- {!Doc.UserDoc().noviceMode && !this.isText && !this.props.isDoc ? <Tooltip key="fwd" title={<div className="dash-tooltip">Forward Frame</div>} placement="bottom">
- <div className="fwdKeyframe" onClick={this.nextKeyframe}>
- <FontAwesomeIcon icon={"caret-right"} size={"lg"} />
- </div>
- </Tooltip> : null}
+ {!Doc.UserDoc().noviceMode && !this.isText && !this.props.isDoc ?
+ <>
+ <Tooltip key="back" title={<div className="dash-tooltip">Back Frame</div>} placement="bottom">
+ <div className="backKeyframe" onClick={this.prevKeyframe}>
+ <FontAwesomeIcon icon={"caret-left"} size={"lg"} />
+ </div>
+ </Tooltip>
+ <Tooltip key="num" title={<div className="dash-tooltip">Toggle View All</div>} placement="bottom">
+ <div className="numKeyframe" style={{ color: this.document.editing ? "white" : "black", backgroundColor: this.document.editing ? "#5B9FDD" : "#AEDDF8" }}
+ onClick={action(() => this.document.editing = !this.document.editing)} >
+ {NumCast(this.document._currentFrame)}
+ </div>
+ </Tooltip>
+ <Tooltip key="fwd" title={<div className="dash-tooltip">Forward Frame</div>} placement="bottom">
+ <div className="fwdKeyframe" onClick={this.nextKeyframe}>
+ <FontAwesomeIcon icon={"caret-right"} size={"lg"} />
+ </div>
+ </Tooltip>
+ </>
+ : null}
{!this.props.isOverlay || this.document.type !== DocumentType.WEB || this.isText || this.props.isDoc ? (null) :
this.urlEditor
@@ -872,7 +871,7 @@ export class CollectionFreeFormViewChrome extends React.Component<CollectionMenu
</> :
(null)
}
- {this.isText ? <RichTextMenu /> : null}
+ {<div style={{ display: !this.isText ? "none" : undefined }}><RichTextMenu /></div>}
</div>;
}
}