aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 139ac11db..1526dad34 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -232,9 +232,10 @@ export class MainView extends React.Component {
this.createNewWorkspace();
}
} else {
- DocServer.GetRefField(CurrentUserUtils.MainDocId).then(field =>
+ DocServer.GetRefField(CurrentUserUtils.MainDocId).then(field => {
field instanceof Doc ? this.openWorkspace(field) :
- this.createNewWorkspace(CurrentUserUtils.MainDocId));
+ this.createNewWorkspace(CurrentUserUtils.MainDocId)
+ });
}
}
@@ -292,6 +293,7 @@ export class MainView extends React.Component {
}
}
}, 100);
+ return true;
}
onDrop = (e: React.DragEvent<HTMLDivElement>) => {
@@ -323,7 +325,7 @@ export class MainView extends React.Component {
<DocumentView Document={mainCont}
DataDoc={undefined}
addDocument={undefined}
- addDocTab={emptyFunction}
+ addDocTab={this.addDocTabFunc}
pinToPres={emptyFunction}
onClick={undefined}
ruleProvider={undefined}
@@ -339,6 +341,7 @@ export class MainView extends React.Component {
whenActiveChanged={emptyFunction}
bringToFront={emptyFunction}
ContainingCollectionView={undefined}
+ ContainingCollectionDoc={undefined}
zoomToScale={emptyFunction}
getScale={returnOne}
/>}
@@ -371,11 +374,14 @@ export class MainView extends React.Component {
document.removeEventListener("pointerup", this.onPointerUp);
}
flyoutWidthFunc = () => this.flyoutWidth;
- addDocTabFunc = (doc: Doc) => {
+ addDocTabFunc = (doc: Doc, data: Opt<Doc>, where: string) => {
+ if (where === "close")
+ return CollectionDockingView.CloseRightSplit(doc);
if (doc.dockingConfig) {
this.openWorkspace(doc);
+ return true;
} else {
- CollectionDockingView.Instance.AddRightSplit(doc, undefined);
+ return CollectionDockingView.AddRightSplit(doc, undefined);
}
}
@computed
@@ -403,6 +409,7 @@ export class MainView extends React.Component {
whenActiveChanged={emptyFunction}
bringToFront={emptyFunction}
ContainingCollectionView={undefined}
+ ContainingCollectionDoc={undefined}
zoomToScale={emptyFunction}
getScale={returnOne}>
</DocumentView>;