From 40033dedb5319aa0fd00ff3156d6bb19015dfdfe Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 15 Sep 2020 10:17:08 -0400 Subject: outline mode for tree views now always hidesHeader fields in favor of displaying the document. This allows slide items to appear normally as titles in other tree views (eg dashboard) --- src/client/views/collections/CollectionTreeView.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index b27f75837..1aa3a9364 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -145,13 +145,11 @@ class TreeView extends React.Component { } componentWillUnmount() { - console.log("DISMOUT" + this.doc.title); document.removeEventListener("pointermove", this.onDragMove, true); document.removeEventListener("pointermove", this.onDragUp, true); } onDragUp = (e: PointerEvent) => { - console.log("DUP" + this.doc.title); document.removeEventListener("pointerup", this.onDragUp, true); document.removeEventListener("pointermove", this.onDragMove, true); } @@ -163,7 +161,6 @@ class TreeView extends React.Component { document.addEventListener("pointermove", this.onDragMove, true); document.removeEventListener("pointerup", this.onDragUp, true); document.addEventListener("pointerup", this.onDragUp, true); - console.log("DSTART" + this.doc.title); } } onPointerLeave = (e: React.PointerEvent): void => { @@ -171,7 +168,6 @@ class TreeView extends React.Component { if (this._header?.current?.className !== "treeViewItem-header-editing") { this._header!.current!.className = "treeViewItem-header"; } - console.log("DLEAVE" + this.doc.title); document.removeEventListener("pointerup", this.onDragUp, true); document.removeEventListener("pointermove", this.onDragMove, true); } @@ -189,7 +185,7 @@ class TreeView extends React.Component { } public static makeTextBullet() { - const bullet = Docs.Create.TextDocument("-text-", { title: "-title-", _viewType: CollectionViewType.Tree, treeViewHideHeader: true, hideLinkButton: true, _showSidebar: true, treeViewOutlineMode: true, x: 0, y: 0, _xMargin: 0, _yMargin: 0, _autoHeight: true, _singleLine: true, _backgroundColor: "transparent", _width: 1000, _height: 10, templates: new List([Templates.Title.Layout]) }); + const bullet = Docs.Create.TextDocument("-text-", { title: "-title-", _viewType: CollectionViewType.Tree, hideLinkButton: true, _showSidebar: true, treeViewOutlineMode: true, x: 0, y: 0, _xMargin: 0, _yMargin: 0, _autoHeight: true, _singleLine: true, _backgroundColor: "transparent", _width: 1000, _height: 10, templates: new List([Templates.Title.Layout]) }); Doc.GetProto(bullet).layout = CollectionView.LayoutString("data"); Doc.GetProto(bullet).title = ComputedField.MakeFunction('self.text?.Text'); Doc.GetProto(bullet).data = new List([]); @@ -568,7 +564,7 @@ class TreeView extends React.Component { } } else this._editMaxWidth = ""; const selected = SelectionManager.IsSelected(DocumentManager.Instance.getFirstDocumentView(this.doc)); - return this.doc.treeViewHideHeader ? + return this.doc.treeViewHideHeader || this.outlineMode ? !StrCast(Doc.LayoutField(this.doc)).includes("CollectionView") ? this.renderContent :
this.props.active(true) && SelectionManager.DeselectAll()} onKeyDown={e => { -- cgit v1.2.3-70-g09d2