diff options
author | bobzel <zzzman@gmail.com> | 2020-09-10 22:54:54 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-09-10 22:54:54 -0400 |
commit | 2f7cdda3c766e900ae8f2ae5c6853cfb2d352d7a (patch) | |
tree | 4774e4fa87213c7362c3cc08bcdadfeb69265fc2 /src | |
parent | 4f8fb6a10982309c7fcbfa479df36c14aba0198d (diff) |
small fix to allow expanded images in treeviews to be moved and treeView expanded items to be right-clicked for a context menu
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionTreeView.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 08906218a..d1a2fd33e 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -339,7 +339,7 @@ class TreeView extends React.Component<TreeViewProps> { const docs = expandKey === "links" ? this.childLinks : expandKey === "annotations" ? this.childAnnos : this.childDocs; const sortKey = `${this.fieldKey}-sortAscending`; return <ul key={expandKey + "more"} className={this.doc.treeViewHideTitle ? "no-indent" : ""} onClick={(e) => { - this.doc[sortKey] = (this.doc[sortKey] ? false : (this.doc[sortKey] === false ? undefined : true)); + !this.props.treeView.Document.treeViewOutlineMode && (this.doc[sortKey] = (this.doc[sortKey] ? false : (this.doc[sortKey] === false ? undefined : true))); e.stopPropagation(); }}> {!docs ? (null) : @@ -379,10 +379,10 @@ class TreeView extends React.Component<TreeViewProps> { ContainingCollectionDoc={this.props.containingCollection} ContainingCollectionView={undefined} addDocument={returnFalse} - moveDocument={this.props.moveDocument} + moveDocument={this.move} removeDocument={this.props.removeDoc} parentActive={this.props.active} - whenActiveChanged={emptyFunction} + whenActiveChanged={this.props.whenActiveChanged} addDocTab={this.props.addDocTab} pinToPres={this.props.pinToPres} bringToFront={returnFalse} @@ -657,7 +657,7 @@ class TreeView extends React.Component<TreeViewProps> { } }; const addDocument = (doc: Doc | Doc[], relativeTo?: Doc, before?: boolean) => { - return add(doc, relativeTo ? relativeTo : docs[i], before !== undefined ? before : false); + return add(doc, relativeTo ?? docs[i], before !== undefined ? before : false); }; const childLayout = Doc.Layout(pair.layout); const rowHeight = () => { |