From feebbe1a82e3dcff22502f635b67df55c90502b3 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 18 Sep 2020 16:53:30 -0400 Subject: added maximum height to stacking items in sidebar using childLimitHeight. made stacking items non-interactive using contentsPointerEvents. made all links pubilc for now. --- src/client/views/nodes/DocumentView.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/client/views/nodes/DocumentView.tsx') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 68328ea4b..ff5c4d1e9 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -80,6 +80,7 @@ export interface DocumentViewProps { PanelWidth: () => number; PanelHeight: () => number; pointerEvents?: string; + contentsPointerEvents?: string; focus: (doc: Doc, willZoom: boolean, scale?: number, afterFocus?: DocFocusFunc) => void; parentActive: (outsideReaction: boolean) => boolean; whenActiveChanged: (isActive: boolean) => void; @@ -892,11 +893,11 @@ export class DocumentView extends DocComponent(Docu isSelected = (outsideReaction?: boolean) => SelectionManager.IsSelected(this, outsideReaction); select = (ctrlPressed: boolean) => { SelectionManager.SelectDoc(this, ctrlPressed); }; - chromeHeight = () => { - const excluded = ["PresBox", "FormattedTextBox", "FontIconBox"]; - const showTextTitle = this.ShowTitle && !excluded.includes(StrCast(this.layoutDoc.layout)) ? this.ShowTitle : undefined; - return showTextTitle ? 25 : 1; + @computed get showOverlappingTitle() { + const excluded = ["PresBox", /* "FormattedTextBox", */ "FontIconBox"]; // bcz: shifting the title for texst causes problems with collaborative use when some people see titles, and others don't + return this.ShowTitle && !excluded.includes(StrCast(this.layoutDoc.layout)) ? this.ShowTitle : undefined; } + chromeHeight = () => this.showOverlappingTitle ? 1 : 25; @computed get finalLayoutKey() { if (typeof this.props.layoutKey === "string") { @@ -913,7 +914,7 @@ export class DocumentView extends DocComponent(Docu @computed get contents() { const pos = this.props.relative ? "relative " : "absolute"; TraceMobx(); - return (
+ return (
(Docu const showTitleHover = StrCast(this.layoutDoc._showTitleHover); const showCaption = StrCast(this.layoutDoc._showCaption); - const showTextTitle = this.ShowTitle && this.rootDoc.type === DocumentType.RTF ? this.ShowTitle : undefined; const captionView = (!showCaption ? (null) :
(Docu
); const titleView = (!this.ShowTitle ? (null) :
users.user.email === this.dataDoc.author)?.userColor || (this.rootDoc.type === DocumentType.RTF ? StrCast(Doc.UserDoc().userColor) : "rgba(0,0,0,0.4)"), pointerEvents: this.onClickHandler || this.Document.ignoreClick ? "none" : undefined, }}> @@ -1054,7 +1054,7 @@ export class DocumentView extends DocComponent(Docu return !this.ShowTitle && !showCaption ? this.contents :
- {this.Document.type !== DocumentType.RTF ? <> {this.contents} {titleView} : <> {titleView} {this.contents} } + {this.showOverlappingTitle ? <> {this.contents} {titleView} : <> {titleView} {this.contents} } {captionView}
; } -- cgit v1.2.3-70-g09d2