diff options
author | bobzel <zzzman@gmail.com> | 2023-06-15 12:54:10 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-06-15 12:54:10 -0400 |
commit | c4436c837a38d666bc0ff332e224b819fbd3c729 (patch) | |
tree | 9795452dc856c7c06bcd8756ea2fcefbf9b3481f /src/client/views/DocumentDecorations.tsx | |
parent | 3899a3cb58965eb71582c9cb5cdc31d27ec91e72 (diff) | |
parent | 40579c8b3cf0504ac10e966e640af58e8876acd3 (diff) |
Merge branch 'collaboration-sarah' of https://github.com/brown-dash/Dash-Web into collaboration-sarah
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r-- | src/client/views/DocumentDecorations.tsx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 79e3bd64f..68635c00e 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -165,6 +165,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P @action onContainerDown = (e: React.PointerEvent): void => { const first = SelectionManager.Views()[0]; const effectiveAcl = GetEffectiveAcl(first.rootDoc); + console.log(effectiveAcl) if (effectiveAcl == AclAdmin || effectiveAcl == AclEdit || effectiveAcl == AclAugment) { setupMoveUpEvents( this, @@ -198,7 +199,12 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P @action onBackgroundMove = (dragTitle: boolean, e: PointerEvent): boolean => { - const dragDocView = SelectionManager.Views()[0]; + const first = SelectionManager.Views()[0]; + const effectiveAcl = GetEffectiveAcl(first.rootDoc); + if (effectiveAcl != AclAdmin && effectiveAcl != AclEdit && effectiveAcl != AclAugment){ + return false; + } +const dragDocView = SelectionManager.Views()[0]; const containers = new Set<Doc | undefined>(); SelectionManager.Views().forEach(v => containers.add(DocCast(v.rootDoc.embedContainer))); if (containers.size > 1) return false; @@ -864,16 +870,16 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P )} </div> ); + const sharingMenu = docShareMode ? ( - <div - className="documentDecorations-share" - onPointerDown={e => + <div className='documentDecorations-share' + onPointerDown={e => setupMoveUpEvents( - this, - e, - returnFalse, - returnFalse, - action(() => (SettingsManager.propertiesWidth = 250)) + this, + e, + e => this.onBackgroundMove(true, e), + returnFalse, + action(() => SettingsManager.propertiesWidth =250) ) }> <div className={`documentDecorations-share${shareMode}`}> @@ -916,7 +922,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P {hideDeleteButton ? null : topBtn('close', 'times', undefined, e => this.onCloseClick(true), 'Close')} {hideResizers || hideDeleteButton ? null : topBtn('minimize', 'window-maximize', undefined, e => this.onCloseClick(undefined), 'Minimize')} {hideTitle ? null : titleArea} - {hideOpenButton ? null : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Lightbox (ctrl: as new embedding, shift: in new collection)')} + {hideOpenButton ? <div /> : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Lightbox (ctrl: as alias, shift: in new collection)')} </div> {hideResizers ? null : ( <> |