aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-15 10:17:08 -0400
committerbobzel <zzzman@gmail.com>2020-09-15 10:17:08 -0400
commit40033dedb5319aa0fd00ff3156d6bb19015dfdfe (patch)
treef3a056ce2bf312c5b3c6a113c44f4a5915dafbf2 /src
parent79fc15f3b7e5e7068902c506dff8132f06f66d6a (diff)
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)
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx8
1 files changed, 2 insertions, 6 deletions
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<TreeViewProps> {
}
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<TreeViewProps> {
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<TreeViewProps> {
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<TreeViewProps> {
}
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<string>([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<string>([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<Doc>([]);
@@ -568,7 +564,7 @@ class TreeView extends React.Component<TreeViewProps> {
}
} 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 :
<div className={`treeViewItem-container${selected ? "-active" : ""}`} ref={this.createTreeDropTarget} onPointerDown={e => this.props.active(true) && SelectionManager.DeselectAll()}
onKeyDown={e => {