From 49b227417e95871b1302a9f93a32b8b7397bb8f4 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 3 Aug 2020 09:24:24 -0400 Subject: fixed richtextBar icons. fixed run-time warnings --- src/client/views/collections/CollectionMenu.tsx | 109 ++++++++++----------- .../views/nodes/formattedText/RichTextMenu.tsx | 10 +- src/fields/Doc.ts | 2 +- 3 files changed, 59 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx index ec3b3dc0c..8c4118e89 100644 --- a/src/client/views/collections/CollectionMenu.tsx +++ b/src/client/views/collections/CollectionMenu.tsx @@ -87,8 +87,7 @@ export default class CollectionMenu extends AntimodeMenu { const propTitle = CurrentUserUtils.propertiesWidth > 0 ? "Close Properties Panel" : "Open Properties Panel"; const prop = {propTitle}} key="properties" placement="bottom"> - ; @@ -372,7 +371,7 @@ export class CollectionViewBaseChrome extends React.ComponentToggle Overlay Layer} placement="bottom"> @@ -451,10 +450,6 @@ export class CollectionFreeFormViewChrome extends React.Component {this._draw.map((icon, i) => - {this._title[i]}} placement="bottom"> + {this._title[i]}} placement="bottom"> )} ; @@ -594,53 +587,55 @@ export class CollectionFreeFormViewChrome extends React.Component - {this.props.docView.props.renderDepth !== 0 || this.isText ? (null) : Toggle Mini Map} placement="bottom"> -
- -
-
- } - {!!!this.isText ? Back Frame} placement="bottom"> -
- -
-
: null} - {!!!this.isText ? Toggle View All} placement="bottom"> -
this.document.editing = !this.document.editing)} > - {NumCast(this.document.currentFrame)} -
-
: null} - {!!!this.isText ? Forward Frame} placement="bottom"> -
- -
-
: null} - - {!this.props.isOverlay || this.document.type !== DocumentType.WEB || this.isText ? (null) : - Use Hypothesis} placement="bottom"> - - - } - {(!this.props.isOverlay || this.props.docView.layoutDoc.isAnnotating) && !this.isText ? - <> - {this.drawButtons} - {this.widthPicker} - {this.colorPicker} - {this.fillPicker} - : - (null) - } - {this.isText ? : null} - ; + return !this.props.docView.layoutDoc ? (null) : +
+ {this.props.docView.props.renderDepth !== 0 || this.isText ? (null) : + Toggle Mini Map
} placement="bottom"> +
+ +
+
+ } + {!this.isText ? Back Frame} placement="bottom"> +
+ +
+
: null} + {!this.isText ? Toggle View All} placement="bottom"> +
this.document.editing = !this.document.editing)} > + {NumCast(this.document.currentFrame)} +
+
: null} + {!this.isText ? Forward Frame} placement="bottom"> +
+ +
+
: null} + + {!this.props.isOverlay || this.document.type !== DocumentType.WEB || this.isText ? (null) : + Use Hypothesis} placement="bottom"> + + + } + {(!this.props.isOverlay || this.props.docView.layoutDoc.isAnnotating) && !this.isText ? + <> + {this.drawButtons} + {this.widthPicker} + {this.colorPicker} + {this.fillPicker} + : + (null) + } + {this.isText ? : null} + ; } } @observer diff --git a/src/client/views/nodes/formattedText/RichTextMenu.tsx b/src/client/views/nodes/formattedText/RichTextMenu.tsx index d7b6da52e..6e268be48 100644 --- a/src/client/views/nodes/formattedText/RichTextMenu.tsx +++ b/src/client/views/nodes/formattedText/RichTextMenu.tsx @@ -800,7 +800,9 @@ export default class RichTextMenu extends AntimodeMenu { const link = this.currentLink ? this.currentLink : ""; const button = set hyperlink} placement="bottom"> -
+
; const dropdownContent = @@ -1056,10 +1058,10 @@ export class ButtonDropdown extends React.Component { render() { return (
this.ref = node}> - +
+
{this.showDropdown ? this.props.dropdownContent : (null)} ); diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 6d01785aa..f4505d475 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -409,7 +409,7 @@ export namespace Doc { // and returns the document who's proto is undefined or whose proto is marked as a base prototype ('isPrototype'). export function GetProto(doc: Doc): Doc { if (doc instanceof Promise) { - console.log("GetProto: error: got Promise insead of Doc"); + console.log("GetProto: warning: got Promise insead of Doc"); } const proto = doc && (Doc.GetT(doc, "isPrototype", "boolean", true) ? doc : (doc.proto || doc)); return proto === doc ? proto : Doc.GetProto(proto); -- cgit v1.2.3-70-g09d2