aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/TabDocView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-08-22 14:21:11 -0400
committerbobzel <zzzman@gmail.com>2021-08-22 14:21:11 -0400
commit529e1cdb46a3af4fc44ad2bff6afd879fd1558ad (patch)
tree09aeac1754026f3d9f83f6c5aae3ebaf8f56522b /src/client/views/collections/TabDocView.tsx
parent3051d9a16dff8efbf4d32465812093cae7508c74 (diff)
started to fix issues with recognizing ink strokes. fixed minimizing presentation box by fixing TabDocViews to provide a working removeDocument prop
Diffstat (limited to 'src/client/views/collections/TabDocView.tsx')
-rw-r--r--src/client/views/collections/TabDocView.tsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 1969d728c..e24fcf372 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -11,7 +11,6 @@ import { DataSym, Doc, DocListCast, DocListCastAsync, HeightSym, Opt, WidthSym }
import { Id } from '../../../fields/FieldSymbols';
import { FieldId } from "../../../fields/RefField";
import { BoolCast, Cast, NumCast, StrCast } from "../../../fields/Types";
-import { TraceMobx } from '../../../fields/util';
import { emptyFunction, lightOrDark, returnEmptyDoclist, returnFalse, returnTrue, setupMoveUpEvents, Utils } from "../../../Utils";
import { DocServer } from "../../DocServer";
import { DocUtils } from '../../documents/Documents';
@@ -313,6 +312,14 @@ export class TabDocView extends React.Component<TabDocViewProps> {
return CollectionDockingView.AddSplit(doc, locationParams, this.stack);
}
}
+ remDocTab = (doc: Doc | Doc[]) => {
+ if (doc === this._document) {
+ SelectionManager.DeselectAll();
+ CollectionDockingView.CloseSplit(this._document);
+ return true;
+ }
+ return false;
+ }
getCurrentFrame = () => {
return NumCast(Cast(PresBox.Instance.childDocs[PresBox.Instance.itemIndex].presentationTargetDoc, Doc, null)._currentFrame);
@@ -349,7 +356,6 @@ export class TabDocView extends React.Component<TabDocViewProps> {
@computed get layerProvider() { return this._document && DefaultLayerProvider(this._document); }
@computed get docView() {
- TraceMobx();
return !this._activated || !this._document || this._document._viewType === CollectionViewType.Docking ? (null) :
<><DocumentView key={this._document[Id]} ref={action((r: DocumentView) => this._view = r)}
renderDepth={0}
@@ -366,7 +372,7 @@ export class TabDocView extends React.Component<TabDocViewProps> {
docRangeFilters={CollectionDockingView.Instance.childDocRangeFilters}
searchFilterDocs={CollectionDockingView.Instance.searchFilterDocs}
addDocument={undefined}
- removeDocument={undefined}
+ removeDocument={this.remDocTab}
addDocTab={this.addDocTab}
ScreenToLocalTransform={this.ScreenToLocalTransform}
dontCenter={"y"}
@@ -393,7 +399,6 @@ export class TabDocView extends React.Component<TabDocViewProps> {
}
render() {
- this.tab && CollectionDockingView.Instance.tabMap.delete(this.tab);
return (
<div className="collectionDockingView-content" style={{
fontFamily: Doc.UserDoc().renderStyle === "comic" ? "Comic Sans MS" : undefined,