diff options
| author | geireann <60007097+geireann@users.noreply.github.com> | 2020-07-05 12:32:20 +0800 | 
|---|---|---|
| committer | geireann <60007097+geireann@users.noreply.github.com> | 2020-07-05 12:32:20 +0800 | 
| commit | c7dd9ba9e953adfb8c117bee3b95528d8d8c7304 (patch) | |
| tree | 6aebd235aadb8ff4a4a464697ec4eb9fdcbb091a /src/client/views/DocumentDecorations.tsx | |
| parent | 2c04b0ae3689d931675151acbec24c88ea00daa1 (diff) | |
| parent | 641ddbeefbbc05f8bf586c542595af672826149b (diff) | |
Merge branch 'master' into presentation_updates
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 92 | 
1 files changed, 47 insertions, 45 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 4fda10926..a45ef8862 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -600,52 +600,54 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>                  zIndex: SelectionManager.SelectedDocuments().length > 1 ? 900 : 0,              }} onPointerDown={this.onBackgroundDown} onContextMenu={e => { e.preventDefault(); e.stopPropagation(); }} >              </div> -            <div className="documentDecorations-container" ref={this.setTextBar} style={{ -                width: (bounds.r - bounds.x + this._resizeBorderWidth) + "px", -                height: (bounds.b - bounds.y + this._resizeBorderWidth + this._titleHeight) + "px", -                left: bounds.x - this._resizeBorderWidth / 2, -                top: bounds.y - this._resizeBorderWidth / 2 - this._titleHeight, -            }}> -                {maximizeIcon} -                {titleArea} -                {SelectionManager.SelectedDocuments().length !== 1 || seldoc.Document.type === DocumentType.INK ? (null) : -                    <div className="documentDecorations-iconifyButton" title={`${seldoc.finalLayoutKey.includes("icon") ? "De" : ""}Iconify Document`} onPointerDown={this.onIconifyDown}> -                        {"_"} -                    </div>} -                <div className="documentDecorations-closeButton" title="Open Document in Tab" onPointerDown={this.onMaximizeDown}> -                    {SelectionManager.SelectedDocuments().length === 1 ? DocumentDecorations.DocumentIcon(StrCast(seldoc.props.Document.layout, "...")) : "..."} +            {bounds.r - bounds.x < 15 && bounds.b - bounds.y < 15 ? (null) : <> +                <div className="documentDecorations-container" key="container" ref={this.setTextBar} style={{ +                    width: (bounds.r - bounds.x + this._resizeBorderWidth) + "px", +                    height: (bounds.b - bounds.y + this._resizeBorderWidth + this._titleHeight) + "px", +                    left: bounds.x - this._resizeBorderWidth / 2, +                    top: bounds.y - this._resizeBorderWidth / 2 - this._titleHeight, +                }}> +                    {maximizeIcon} +                    {titleArea} +                    {SelectionManager.SelectedDocuments().length !== 1 || seldoc.Document.type === DocumentType.INK ? (null) : +                        <div className="documentDecorations-iconifyButton" title={`${seldoc.finalLayoutKey.includes("icon") ? "De" : ""}Iconify Document`} onPointerDown={this.onIconifyDown}> +                            {"_"} +                        </div>} +                    <div className="documentDecorations-closeButton" title="Open Document in Tab" onPointerDown={this.onMaximizeDown}> +                        {SelectionManager.SelectedDocuments().length === 1 ? DocumentDecorations.DocumentIcon(StrCast(seldoc.props.Document.layout, "...")) : "..."} +                    </div> +                    <div id="documentDecorations-rotation" className="documentDecorations-rotation" +                        onPointerDown={this.onRotateDown}> ⟲ </div> +                    <div id="documentDecorations-topLeftResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    <div id="documentDecorations-topResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    <div id="documentDecorations-topRightResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    <div id="documentDecorations-leftResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    <div id="documentDecorations-centerCont"></div> +                    <div id="documentDecorations-rightResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    <div id="documentDecorations-bottomLeftResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    <div id="documentDecorations-bottomResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    <div id="documentDecorations-bottomRightResizer" className="documentDecorations-resizer" +                        onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> +                    {seldoc.props.renderDepth <= 1 || !seldoc.props.ContainingCollectionView ? (null) : +                        <div id="documentDecorations-levelSelector" className="documentDecorations-selector" +                            title="tap to select containing document" onPointerDown={this.onSelectorUp} onContextMenu={e => e.preventDefault()}> +                            <FontAwesomeIcon className="documentdecorations-times" icon={faArrowAltCircleUp} size="lg" /> +                        </div>} +                    <div id="documentDecorations-borderRadius" className="documentDecorations-radius" +                        onPointerDown={this.onRadiusDown} onContextMenu={(e) => e.preventDefault()}></div> + +                </div > +                <div className="link-button-container" key="links" style={{ left: bounds.x - this._resizeBorderWidth / 2 + 10, top: bounds.b + this._resizeBorderWidth / 2 }}> +                    <DocumentButtonBar views={SelectionManager.SelectedDocuments} />                  </div> -                <div id="documentDecorations-rotation" className="documentDecorations-rotation" -                    onPointerDown={this.onRotateDown}> ⟲ </div> -                <div id="documentDecorations-topLeftResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                <div id="documentDecorations-topResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                <div id="documentDecorations-topRightResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                <div id="documentDecorations-leftResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                <div id="documentDecorations-centerCont"></div> -                <div id="documentDecorations-rightResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                <div id="documentDecorations-bottomLeftResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                <div id="documentDecorations-bottomResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                <div id="documentDecorations-bottomRightResizer" className="documentDecorations-resizer" -                    onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> -                {seldoc.props.renderDepth <= 1 || !seldoc.props.ContainingCollectionView ? (null) : -                    <div id="documentDecorations-levelSelector" className="documentDecorations-selector" -                        title="tap to select containing document" onPointerDown={this.onSelectorUp} onContextMenu={e => e.preventDefault()}> -                        <FontAwesomeIcon className="documentdecorations-times" icon={faArrowAltCircleUp} size="lg" /> -                    </div>} -                <div id="documentDecorations-borderRadius" className="documentDecorations-radius" -                    onPointerDown={this.onRadiusDown} onContextMenu={(e) => e.preventDefault()}></div> - -            </div > -            <div className="link-button-container" style={{ left: bounds.x - this._resizeBorderWidth / 2 + 10, top: bounds.b + this._resizeBorderWidth / 2 }}> -                <DocumentButtonBar views={SelectionManager.SelectedDocuments} /> -            </div> +            </>}          </div >          );      }  | 
