aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-09-19 00:41:11 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-09-19 00:41:11 -0400
commitbf4f4cb2e2997cb0ff6c86eef68b3d6b0310f319 (patch)
tree74bf6f581324655332be42aa0a99f6a5f8d3c703
parentbe5456616a7813572b9fdc9637d4009e7283a46a (diff)
more cleanup of document view
-rw-r--r--src/client/views/DocumentDecorations.tsx1
-rw-r--r--src/client/views/nodes/DocumentView.tsx21
2 files changed, 7 insertions, 15 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index ad38d16aa..4582c5b0c 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -381,7 +381,6 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
IconBox.AutomaticTitle(iconDoc);
//iconDoc.proto![this._fieldKey] = selected.length > 1 ? "collection" : undefined;
- iconDoc.proto!.isMinimized = false;
iconDoc.width = Number(MINIMIZED_ICON_SIZE);
iconDoc.height = Number(MINIMIZED_ICON_SIZE);
iconDoc.x = NumCast(doc.x);
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 39bba2eb2..4a37457c0 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -242,27 +242,20 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
if (expandedDocs.length) {
SelectionManager.DeselectAll();
let maxLocation = StrCast(this.Document.maximizeLocation, "inPlace");
- let getDispDoc = (target: Doc) => Object.getOwnPropertyNames(target).indexOf("isPrototype") === -1 ? target : Doc.MakeDelegate(target);
if (altKey || ctrlKey) {
- maxLocation = this.Document.maximizeLocation = (ctrlKey ? maxLocation : (maxLocation === "inPlace" || !maxLocation ? "inTab" : "inPlace"));
- if (!maxLocation || maxLocation === "inPlace") {
+ maxLocation = this.Document.maximizeLocation = (ctrlKey ? maxLocation : (maxLocation === "inPlace" ? "inTab" : "inPlace"));
+ if (maxLocation === "inPlace") {
let hadView = expandedDocs.length === 1 && DocumentManager.Instance.getDocumentView(expandedDocs[0], this.props.ContainingCollectionView);
let wasMinimized = !hadView && expandedDocs.reduce((min, d) => !min && !d.isMinimized, false);
- expandedDocs.forEach(maxDoc => Doc.GetProto(maxDoc).isMinimized = false);
+ expandedDocs.forEach(maxDoc => maxDoc.isMinimized = false);
let hasView = expandedDocs.length === 1 && DocumentManager.Instance.getDocumentView(expandedDocs[0], this.props.ContainingCollectionView);
- if (!hasView) {
- this.props.addDocument && expandedDocs.forEach(async maxDoc => this.props.addDocument!(getDispDoc(maxDoc), false));
- }
+ !hasView && expandedDocs.forEach(async maxDoc => this.props.addDocument && this.props.addDocument(maxDoc, false));
expandedDocs.forEach(maxDoc => maxDoc.isMinimized = wasMinimized);
}
}
- if (maxLocation && maxLocation !== "inPlace" && CollectionDockingView.Instance) {
- let dataDocs = DocListCast(CollectionDockingView.Instance.props.Document.data);
- if (dataDocs) {
- expandedDocs.forEach(maxDoc =>
- (!CollectionDockingView.Instance.CloseRightSplit(Doc.GetProto(maxDoc)) &&
- this.props.addDocTab(getDispDoc(maxDoc), undefined, maxLocation)));
- }
+ if (maxLocation !== "inPlace" && CollectionDockingView.Instance) {
+ expandedDocs.forEach(maxDoc =>
+ (!CollectionDockingView.Instance.CloseRightSplit(maxDoc) && this.props.addDocTab(maxDoc, undefined, maxLocation)));
} else {
let scrpt = this.props.ScreenToLocalTransform().scale(this.props.ContentScaling()).inverse().transformPoint(NumCast(this.Document.width) / 2, NumCast(this.Document.height) / 2);
this.collapseTargetsToPoint(scrpt, expandedDocs);