diff options
| author | bobzel <zzzman@gmail.com> | 2023-07-05 16:15:27 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-07-05 16:15:27 -0400 |
| commit | 5a9af979cc293d0e3843270ee053c24bf0eb6ef5 (patch) | |
| tree | 1c03d5fb55a97f5e3da96a448af5079ec2b0e42b /src/client/views/DocumentDecorations.tsx | |
| parent | bf609fdadc164da5663671a0c42c3a13056ee376 (diff) | |
changed acl inheritance for docking views.
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 4454a3ec1..cdd9e62d8 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -201,9 +201,9 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P onBackgroundMove = (dragTitle: boolean, e: PointerEvent): boolean => { const first = SelectionManager.Views()[0]; const effectiveLayoutAcl = GetEffectiveLayoutAcl(first.rootDoc); - if (effectiveLayoutAcl != AclAdmin && effectiveLayoutAcl != AclEdit && effectiveLayoutAcl != AclAugment){ + if (effectiveLayoutAcl != AclAdmin && effectiveLayoutAcl != AclEdit && effectiveLayoutAcl != AclAugment) { return false; - } + } const dragDocView = SelectionManager.Views()[0]; const containers = new Set<Doc | undefined>(); SelectionManager.Views().forEach(v => containers.add(DocCast(v.rootDoc.embedContainer))); @@ -766,13 +766,14 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P // sharing const acl = this.showLayoutAcl ? GetEffectiveLayoutAcl(seldocview.rootDoc) : GetEffectiveAcl(seldocview.rootDoc); - const docShareMode = HierarchyMapping.get(acl)!.name + const docShareMode = HierarchyMapping.get(acl)!.name; const shareMode = StrCast(docShareMode); var shareSymbolIcon = ReverseHierarchyMap.get(shareMode)?.image; // hide the decorations if the parent chooses to hide it or if the document itself hides it const hideDecorations = seldocview.props.hideDecorations || seldocview.rootDoc.hideDecorations; - const hideResizers = ![AclAdmin, AclEdit, AclAugment].includes(GetEffectiveLayoutAcl(seldocview.rootDoc)) || hideDecorations || seldocview.props.hideResizeHandles || seldocview.rootDoc.layout_hideResizeHandles || this._isRounding || this._isRotating; + const hideResizers = + ![AclAdmin, AclEdit, AclAugment].includes(GetEffectiveLayoutAcl(seldocview.rootDoc)) || hideDecorations || seldocview.props.hideResizeHandles || seldocview.rootDoc.layout_hideResizeHandles || this._isRounding || this._isRotating; const hideTitle = hideDecorations || seldocview.props.hideDecorationTitle || seldocview.rootDoc.layout_hideDecorationTitle || this._isRounding || this._isRotating; const hideDocumentButtonBar = hideDecorations || seldocview.props.hideDocumentButtonBar || seldocview.rootDoc.layout_hideDocumentButtonBar || this._isRounding || this._isRotating; // if multiple documents have been opened at the same time, then don't show open button @@ -826,26 +827,26 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P const radiusHandleLocation = Math.min(radiusHandle, maxDist); const sharingMenu = docShareMode ? ( - <div className='documentDecorations-share' > + <div className="documentDecorations-share"> <div className={`documentDecorations-share${shareMode}`}> {shareSymbolIcon + ' ' + shareMode} - {!Doc.noviceMode ? - <div className='checkbox'> - <div className='checkbox-box'> - <input type="checkbox" checked={this.showLayoutAcl} onChange={action(() => (this.showLayoutAcl = !this.showLayoutAcl))} /> + {!Doc.noviceMode ? ( + <div className="checkbox"> + <div className="checkbox-box"> + <input type="checkbox" checked={this.showLayoutAcl} onChange={action(() => (this.showLayoutAcl = !this.showLayoutAcl))} /> </div> - <div className='checkbox-text'> Layout </div> + <div className="checkbox-text"> Layout </div> </div> - : null } + ) : null} </div> </div> ) : ( <div /> ); - + const titleArea = this._editingTitle ? ( <input ref={this._keyinput} @@ -860,8 +861,17 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P onPointerDown={e => e.stopPropagation()} /> ) : ( - <div className="documentDecorations-title" key="title" onPointerDown={e => {e.stopPropagation}}> - { hideTitle ? null : <span className={`documentDecorations-titleSpan${colorScheme}`} onPointerDown={this.onTitleDown}>{this.selectionTitle}</span>} + <div + className="documentDecorations-title" + key="title" + onPointerDown={e => { + e.stopPropagation; + }}> + {hideTitle ? null : ( + <span className={`documentDecorations-titleSpan${colorScheme}`} onPointerDown={this.onTitleDown}> + {this.selectionTitle} + </span> + )} {sharingMenu} {!useLock ? null : ( <Tooltip key="lock" title={<div className="dash-tooltip">toggle ability to interact with document</div>} placement="top"> @@ -872,7 +882,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P )} </div> ); - + return ( <div className={`documentDecorations${colorScheme}`} style={{ opacity: this._showNothing ? 0.1 : undefined }}> <div |
