aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionTreeView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/CollectionTreeView.tsx')
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx
index 525fa8ca1..d80534ef9 100644
--- a/src/client/views/collections/CollectionTreeView.tsx
+++ b/src/client/views/collections/CollectionTreeView.tsx
@@ -165,6 +165,7 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
DataDoc={undefined}
LayoutTemplateString={FormattedTextBox.LayoutString("text")}
renderDepth={this.props.renderDepth + 1}
+ isContentActive={() => this.props.isContentActive() || this.props.isSelected()}
rootSelected={returnTrue}
//dontRegisterView={true}
docViewPath={this.props.docViewPath}
@@ -184,8 +185,7 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
addDocument={this.props.addDocument}
moveDocument={returnFalse}
removeDocument={returnFalse}
- parentActive={this.props.active}
- whenActiveChanged={this.props.whenActiveChanged}
+ whenChildContentsActiveChanged={this.props.whenChildContentsActiveChanged}
addDocTab={this.props.addDocTab}
pinToPres={this.props.pinToPres}
bringToFront={returnFalse}
@@ -197,8 +197,8 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
@computed get outlineMode() { return this.doc.treeViewType === "outline"; }
@computed get fileSysMode() { return this.doc.treeViewType === "fileSystem"; }
onChildClick = () => this.props.onChildClick?.() || ScriptCast(this.doc.onChildClick);
- whenActiveChanged = (isActive: boolean) => { this.props.whenActiveChanged(this._isChildActive = isActive); };
- active = (outsideReaction: boolean | undefined) => this.props.active(outsideReaction) || this._isChildActive;
+ whenChildContentsActiveChanged = (isActive: boolean) => { this.props.whenChildContentsActiveChanged(this._isChildActive = isActive); };
+ active = (outsideReaction: boolean | undefined) => this.props.isContentActive(outsideReaction) || this._isChildActive;
panelWidth = () => this.props.PanelWidth() - 20; // bcz: 20 is the 10 + 10 for the left and right padding.
@computed get treeChildren() {
TraceMobx();
@@ -213,7 +213,7 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
moveDoc, dropAction, this.props.addDocTab, this.props.pinToPres, this.props.styleProvider, returnTrue, this.props.ScreenToLocalTransform,
this.outerXf, this.active, this.panelWidth, this.props.renderDepth, () => this.props.treeViewHideHeaderFields || BoolCast(this.doc.treeViewHideHeaderFields),
BoolCast(this.doc.treeViewPreventOpen), [], this.props.onCheckedClick,
- this.onChildClick, this.props.treeViewSkipFields, true, this.whenActiveChanged, this.props.dontRegisterView || Cast(this.props.Document.childDontRegisterViews, "boolean", null), this);
+ this.onChildClick, this.props.treeViewSkipFields, true, this.whenChildContentsActiveChanged, this.props.dontRegisterView || Cast(this.props.Document.childDontRegisterViews, "boolean", null), this);
}
@computed get titleBar() {
const hideTitle = this.props.treeViewHideTitle || this.doc.treeViewHideTitle;
@@ -225,13 +225,13 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
const background = this.props.styleProvider?.(this.doc, this.props, StyleProp.BackgroundColor);
const paddingX = `${NumCast(this.doc._xPadding, 15)}px`;
const paddingTop = `${NumCast(this.doc._yPadding, 20)}px`;
- const pointerEvents = !this.props.active() && !SnappingManager.GetIsDragging() && !this._isChildActive ? "none" : undefined;
+ const pointerEvents = !this.props.isContentActive() && !SnappingManager.GetIsDragging() && !this._isChildActive ? "none" : undefined;
return !this.treeChildren ? (null) : (
<div className="collectionTreeView-container" onContextMenu={this.onContextMenu}>
<div className="collectionTreeView-dropTarget"
style={{ background, paddingLeft: paddingX, paddingRight: paddingX, paddingTop, pointerEvents }}
- onWheel={(e) => this._mainEle && this._mainEle.scrollHeight > this._mainEle.clientHeight && e.stopPropagation()}
+ onWheel={e => e.stopPropagation()}
onDrop={this.onTreeDrop}
ref={this.createTreeDropTarget}>
{this.titleBar}