diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-04-12 20:14:31 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-04-12 20:14:31 -0400 |
| commit | 290feed8a7c2ae700bac0d720874abc511e6cd36 (patch) | |
| tree | 0e7ba9ffe8f2b757ff91f528aa490b928d47e735 /src/client/views/collections/CollectionStackingView.tsx | |
| parent | 22d1499703ddb20d0f937364085e46fefcc663da (diff) | |
fixed nudging stoppropagation stuff. fixed inPlace addDocTab for non freeform views
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionStackingView.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index da53888fc..dd84c4d6e 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -153,6 +153,13 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) { @computed get onChildClickHandler() { return ScriptCast(this.Document.onChildClick); } @computed get onClickHandler() { return ScriptCast(this.Document.onChildClick); } + addDocTab = (doc: Doc, where: string) => { + if (where === "inPlace" && this.layoutDoc.isInPlaceContainer) { + this.dataDoc[this.props.fieldKey] = new List<Doc>([doc]); + return true; + } + return this.props.addDocTab(doc, where); + } getDisplayDoc(doc: Doc, dataDoc: Doc | undefined, dxf: () => Transform, width: () => number) { const layoutDoc = Doc.Layout(doc, this.props.childLayoutTemplate?.()); const height = () => this.getDocHeight(doc); @@ -181,7 +188,7 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) { removeDocument={this.props.removeDocument} active={this.props.active} whenActiveChanged={this.props.whenActiveChanged} - addDocTab={this.props.addDocTab} + addDocTab={this.addDocTab} pinToPres={this.props.pinToPres}> </ContentFittingDocumentView>; } |
