From 47da497aded0bafdc5c85c8a79a9a06d0d401e92 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sun, 17 Mar 2019 00:44:32 -0400 Subject: think I fixed popouts --- src/client/views/Main.tsx | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index fa8875d66..345371884 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -1,4 +1,4 @@ -import { action, configure, observable } from 'mobx'; +import { action, configure, observable, runInAction } from 'mobx'; import "normalize.css"; import * as React from 'react'; import * as ReactDOM from 'react-dom'; @@ -32,8 +32,6 @@ import { faPenNib } from '@fortawesome/free-solid-svg-icons'; import { faFilm } from '@fortawesome/free-solid-svg-icons'; import { faMusic } from '@fortawesome/free-solid-svg-icons'; import Measure from 'react-measure'; -import { withContentRect } from 'react-measure' - configure({ enforceActions: "observed" }); // causes errors to be generated when modifying an observable outside of an action @@ -46,7 +44,7 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) { }), true) const pathname = window.location.pathname.split("/"); const mainDocId = pathname[pathname.length - 1]; -let mainContainer: Document; +var mainContainer: Document; let mainfreeform: Document; class mainDocFrame { @@ -114,15 +112,24 @@ Documents.initProtos(mainDocId, (res?: Document) => { ReactDOM.render((
{/*
— DASH —
*/} - Transform.Identity} - ContentScaling={() => 1} - PanelWidth={() => 0} - PanelHeight={() => 0} - isTopMost={true} - SelectOnLoad={false} - focus={() => { }} - ContainingCollectionView={undefined} /> + runInAction(() => { + mainDocFrame.pwidth = r.entry.width; + mainDocFrame.pheight = r.entry.height; + })}> + {({ measureRef }) => +
+ Transform.Identity} + ContentScaling={() => 1} + PanelWidth={() => mainDocFrame.pwidth} + PanelHeight={() => mainDocFrame.pheight} + isTopMost={true} + SelectOnLoad={false} + focus={() => { }} + ContainingCollectionView={undefined} /> +
+ } +
-- cgit v1.2.3-70-g09d2