aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/views/DocumentDecorations.tsx6
-rw-r--r--src/client/views/MainView.tsx39
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx8
-rw-r--r--src/client/views/nodes/DocumentView.tsx4
4 files changed, 38 insertions, 19 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index c7990647a..e565566c7 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -536,8 +536,8 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
let scale = element.props.ScreenToLocalTransform().Scale * element.props.ContentScaling();
let actualdW = Math.max(width + (dW * scale), 20);
let actualdH = Math.max(height + (dH * scale), 20);
- doc.x = (doc.x || 0) + dX * (actualdW - width);
- doc.y = (doc.y || 0) + dY * (actualdH - height);
+ // doc.x = (doc.x || 0) + dX * (actualdW - width);
+ // doc.y = (doc.y || 0) + dY * (actualdH - height);
let proto = Doc.GetProto(element.props.Document);
let fixedAspect = e.ctrlKey || (!BoolCast(proto.ignoreAspect, false) && nwidth && nheight);
if (fixedAspect && (!nwidth || !nheight)) {
@@ -567,7 +567,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
} else {
dW && (doc.width = actualdW);
dH && (doc.height = actualdH);
- Doc.SetInPlace(element.props.Document, "autoHeight", undefined, true);
+ //Doc.SetInPlace(element.props.Document, "autoHeight", undefined, true);
}
}
});
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 82b17f142..f9a5b2bb7 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -1,7 +1,7 @@
import { IconName, library } from '@fortawesome/fontawesome-svg-core';
import { faArrowDown, faArrowUp, faBell, faCheck, faCommentAlt, faCut, faExclamation, faFilePdf, faFilm, faFont, faGlobeAsia, faImage, faMusic, faObjectGroup, faPenNib, faRedoAlt, faTable, faThumbtack, faTree, faUndoAlt } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { action, computed, configure, observable, runInAction } from 'mobx';
+import { action, computed, configure, observable, runInAction, reaction } from 'mobx';
import { observer } from 'mobx-react';
import "normalize.css";
import * as React from 'react';
@@ -72,6 +72,31 @@ export class MainView extends React.Component {
window.removeEventListener("pointerup", this.pointerUp);
window.addEventListener("pointerup", this.pointerUp);
+
+ reaction(() => {
+ let workspaces = CurrentUserUtils.UserDocument.workspaces;
+ let recent = CurrentUserUtils.UserDocument.recentlyClosed;
+ let fakeLibrary = CurrentUserUtils.UserDocument.fakeLibrary;
+ if (!(recent instanceof Doc)) return 0;
+ if (!(workspaces instanceof Doc)) return 0;
+ if (!(fakeLibrary instanceof Doc)) return 0;
+ let workspacesDoc = workspaces;
+ let recentDoc = recent;
+ let fakeLibraryDoc = fakeLibrary;
+ // console.log("pheight = " + this.getPHeight() + " " + workspacesDoc[HeightSym]() + " " + recentDoc[HeightSym]());
+ let libraryHeight = this.getPHeight() - workspacesDoc[HeightSym]() - recentDoc[HeightSym]();
+ return libraryHeight;
+ }, (libraryHeight: number) => {
+ let fakeLibrary = CurrentUserUtils.UserDocument.fakeLibrary;
+ let cuser: Doc = fakeLibrary as Doc;//CurrentUserUtils.UserDocument;
+ console.log("BEFORE:" + cuser.title + ".height =" + cuser[HeightSym]() + "& .plight = " + cuser.plight);
+ if (libraryHeight && Math.abs(cuser[HeightSym]() - libraryHeight) > 5) {
+ console.log("ASSIGN to height & plight:" + libraryHeight);
+ cuser.height = libraryHeight;
+ cuser.plight = libraryHeight;
+ }
+ console.log("AFTER:" + cuser.title + ".height =" + cuser[HeightSym]() + "& .plight= " + cuser.plight);
+ }, { fireImmediately: true });
}
pointerDown = (e: PointerEvent) => this.isPointerDown = true;
@@ -285,24 +310,18 @@ export class MainView extends React.Component {
CollectionDockingView.Instance.AddRightSplit(doc, undefined);
}
};
+ computing = false;
@computed
get flyout() {
let sidebar = CurrentUserUtils.UserDocument.sidebar;
let workspaces = CurrentUserUtils.UserDocument.workspaces;
let recent = CurrentUserUtils.UserDocument.recentlyClosed;
+ let fakeLibrary = CurrentUserUtils.UserDocument.fakeLibrary;
if (!(sidebar instanceof Doc)) return (null);
if (!(recent instanceof Doc)) return (null);
if (!(workspaces instanceof Doc)) return (null);
- let workspacesDoc = workspaces;
+ if (!(fakeLibrary instanceof Doc)) return (null);
let sidebarDoc = sidebar;
- let recentDoc = recent;
- let library = CurrentUserUtils.UserDocument;
- let gridGap = NumCast(sidebar.gridGap, 10);
- let yMargin = NumCast(sidebar.yMargin, 2 * gridGap);
- let libraryHeight = this.getPHeight() - workspacesDoc[HeightSym]() - recentDoc[HeightSym]() - 2 * gridGap - 2 * yMargin;
- if (Math.abs(library[HeightSym]() - libraryHeight) > 25) {
- setTimeout(() => CurrentUserUtils.UserDocument.height = libraryHeight, 0);
- }
return <DocumentView
Document={sidebarDoc}
DataDoc={undefined}
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 6b4eddec9..ffd05b52d 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -10,7 +10,6 @@ import { ContextMenu } from "../ContextMenu";
import { CollectionSchemaPreview } from "./CollectionSchemaView";
import "./CollectionStackingView.scss";
import { CollectionSubView } from "./CollectionSubView";
-import { resolve } from "bluebird";
import { undoBatch } from "../../util/UndoManager";
import { DragManager } from "../../util/DragManager";
@@ -38,9 +37,10 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
() => {
if (this.singleColumn) {
let children = this.childDocs.filter(d => !d.isMinimized);
- this.props.Document.height = children.reduce((height, d, i) =>
- height + this.singleColDocHeight(d) + (i === children.length - 1 ? this.yMargin : this.gridGap)
- , this.yMargin);
+ let hgtbefore = this.props.Document.height;
+ // this.props.Document.height = children.reduce((height, d, i) =>
+ // height + this.singleColDocHeight(d) + (i === children.length - 1 ? this.yMargin : this.gridGap)
+ // , this.yMargin);
}
}, { fireImmediately: true });
}
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index a84cac37f..8ecc77946 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -564,8 +564,8 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
});
}
- onPointerEnter = (e: React.PointerEvent): void => { this.props.Document.libraryBrush = true; };
- onPointerLeave = (e: React.PointerEvent): void => { this.props.Document.libraryBrush = false; };
+ onPointerEnter = (e: React.PointerEvent): void => { }//this.props.Document.libraryBrush = true; };
+ onPointerLeave = (e: React.PointerEvent): void => { }//this.props.Document.libraryBrush = false; };
isSelected = () => SelectionManager.IsSelected(this);
@action select = (ctrlPressed: boolean) => { SelectionManager.SelectDoc(this, ctrlPressed); };