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.tsx52
1 files changed, 22 insertions, 30 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index f0011d65f..0f7e3188a 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -37,6 +37,7 @@ import { CollectionView, CollectionViewType } from './collections/CollectionView
import "./collections/TreeView.scss";
import { ComponentDecorations } from './ComponentDecorations';
import { ContextMenu } from './ContextMenu';
+import { DashboardView } from './DashboardView';
import { DictationOverlay } from './DictationOverlay';
import { DocumentDecorations } from './DocumentDecorations';
import { GestureOverlay } from './GestureOverlay';
@@ -83,7 +84,7 @@ export class MainView extends React.Component {
@computed private get dashboardTabHeight() { return 27; } // 27 comes form lm.config.defaultConfig.dimensions.headerHeight in goldenlayout.js
@computed private get topOfDashUI() { return Number(DASHBOARD_SELECTOR_HEIGHT.replace("px", "")); }
- @computed private get topOfHeaderBarDoc() { return this.topOfDashUI + this.topMenuHeight(); }
+ @computed private get topOfHeaderBarDoc() { return this.topOfDashUI; }
@computed private get topOfSidebarDoc() { return this.topOfDashUI + this.topMenuHeight(); }
@computed private get topOfMainDoc() { return this.topOfDashUI + this.topMenuHeight() + this.headerBarDocHeight(); }
@computed private get topOfMainDocContent() { return this.topOfMainDoc + this.dashboardTabHeight; }
@@ -179,7 +180,7 @@ export class MainView extends React.Component {
fa.faClone, fa.faCloudUploadAlt, fa.faCommentAlt, fa.faCompressArrowsAlt, fa.faCut, fa.faEllipsisV, fa.faEraser, fa.faExclamation, fa.faFileAlt,
fa.faFileAudio, fa.faFileVideo, fa.faFilePdf, fa.faFilm, fa.faFilter, fa.faFont, fa.faGlobeAmericas, fa.faGlobeAsia, fa.faHighlighter, fa.faLongArrowAltRight, fa.faMousePointer,
fa.faMusic, fa.faObjectGroup, fa.faPause, fa.faPen, fa.faPenNib, fa.faPhone, fa.faPlay, fa.faPortrait, fa.faRedoAlt, fa.faStamp, fa.faStickyNote, fa.faArrowsAltV,
- fa.faTimesCircle, fa.faThumbtack, fa.faTree, fa.faTv, fa.faUndoAlt, fa.faVideo, fa.faAsterisk, fa.faBrain, fa.faImage, fa.faPaintBrush, fa.faTimes, fa.faFlag,
+ fa.faTimesCircle, fa.faThumbtack, fa.faTree, fa.faTv, fa.faUndoAlt, fa.faVideoSlash, fa.faVideo, fa.faAsterisk, fa.faBrain, fa.faImage, fa.faPaintBrush, fa.faTimes, fa.faFlag,
fa.faEye, fa.faArrowsAlt, fa.faQuoteLeft, fa.faSortAmountDown, fa.faAlignLeft, fa.faAlignCenter, fa.faAlignRight, fa.faHeading, fa.faRulerCombined,
fa.faFillDrip, fa.faLink, fa.faUnlink, fa.faBold, fa.faItalic, fa.faClipboard, fa.faUnderline, fa.faStrikethrough, fa.faSuperscript, fa.faSubscript,
fa.faIndent, fa.faEyeDropper, fa.faPaintRoller, fa.faBars, fa.faBrush, fa.faShapes, fa.faEllipsisH, fa.faHandPaper, fa.faMap, fa.faUser, faHireAHelper as any,
@@ -226,17 +227,7 @@ export class MainView extends React.Component {
if (received && !this.userDoc) {
reaction(() => CurrentUserUtils.GuestTarget, target => target && CurrentUserUtils.createNewDashboard(Doc.UserDoc()), { fireImmediately: true });
} else {
- if (received && CurrentUserUtils._urlState.sharing) {
- reaction(() => CollectionDockingView.Instance && CollectionDockingView.Instance.initialized,
- initialized => initialized && received && DocServer.GetRefField(received).then(docField => {
- if (docField instanceof Doc && docField._viewType !== CollectionViewType.Docking) {
- CollectionDockingView.AddSplit(docField, "right");
- }
- }),
- );
- }
- const activeDash = PromiseValue(this.userDoc.activeDashboard);
- activeDash.then(dash => {
+ PromiseValue(this.userDoc.activeDashboard).then(dash => {
if (dash instanceof Doc) CurrentUserUtils.openDashboard(this.userDoc, dash);
else CurrentUserUtils.createNewDashboard(this.userDoc);
});
@@ -286,7 +277,7 @@ export class MainView extends React.Component {
headerBarScreenXf = () => new Transform(-this.leftScreenOffsetOfMainDocView - this.leftMenuFlyoutWidth(), -this.headerBarDocHeight(), 1);
@computed get headerBarDocView() {
- return <div style={{ height: this.headerBarDocHeight() }}>
+ return <div className="mainView-headerBar" style={{ height: this.headerBarDocHeight() }}>
<DocumentView key="headerBarDoc"
Document={this.headerBarDoc}
DataDoc={undefined}
@@ -297,11 +288,12 @@ export class MainView extends React.Component {
styleProvider={DefaultStyleProvider}
rootSelected={returnTrue}
removeDocument={returnFalse}
- fitContentsToDoc={returnTrue}
+ fitContentsToBox={returnTrue}
isDocumentActive={returnTrue} // headerBar is always documentActive (ie, the docView gets pointer events)
isContentActive={returnTrue} // headerBar is awlays contentActive which means its items are always documentActive
ScreenToLocalTransform={this.headerBarScreenXf}
childHideResizeHandles={returnTrue}
+ dontRegisterView={true}
hideResizeHandles={true}
PanelWidth={this.headerBarDocWidth}
PanelHeight={this.headerBarDocHeight}
@@ -502,15 +494,6 @@ export class MainView extends React.Component {
</>;
}
- @computed get headerBar() {
- return !this.userDoc ? (null) :
- <div className="mainView-dashboardArea" style={{
- height: this.headerBarDocHeight(),
- width: "100%",
- }} >
- {this.headerBarDocView}
- </div>;
- }
@computed get mainDashboardArea() {
return !this.userDoc ? (null) :
@@ -592,6 +575,7 @@ export class MainView extends React.Component {
searchFilterDocs={returnEmptyDoclist}
ContainingCollectionView={undefined}
ContainingCollectionDoc={undefined} />
+ {['watching', 'recording'].includes(String(this.userDoc?.presentationMode) ?? '') ? <div style={{ border: '.5rem solid green', padding: '5px' }}>{this.userDoc?.presentationMode}</div> : <></>}
</div>;
}
@computed get snapLines() {
@@ -677,12 +661,20 @@ export class MainView extends React.Component {
{LinkDescriptionPopup.descriptionPopup ? <LinkDescriptionPopup /> : null}
{DocumentLinksButton.LinkEditorDocView ? <LinkMenu clearLinkEditor={action(() => DocumentLinksButton.LinkEditorDocView = undefined)} docView={DocumentLinksButton.LinkEditorDocView} /> : (null)}
{LinkDocPreview.LinkInfo ? <LinkDocPreview {...LinkDocPreview.LinkInfo} /> : (null)}
- <div style={{ position: "relative", display: LightboxView.LightboxDoc ? "none" : undefined, zIndex: 2001 }} >
- <CollectionMenu panelWidth={this.topMenuWidth} panelHeight={this.topMenuHeight} />
- </div>
- <GestureOverlay >
- {this.mainDashboardArea}
- </GestureOverlay>
+
+ {((page:string) => {
+ switch (page) {
+ case "dashboard":
+ default:return <>
+ <div style={{ position: "relative", display: LightboxView.LightboxDoc ? "none" : undefined, zIndex: 1999 }} >
+ <CollectionMenu panelWidth={this.topMenuWidth} panelHeight={this.topMenuHeight} />
+ </div>
+ <GestureOverlay> {this.mainDashboardArea} </GestureOverlay>
+ </>;
+ case "home": return <DashboardView/>;
+ } })(StrCast(Doc.UserDoc().activePage))
+ }
+
<PreviewCursor />
<TaskCompletionBox />
<ContextMenu />