From c0d63fed441650d38e56d04e920f94ff1b6a3134 Mon Sep 17 00:00:00 2001 From: geireann <60007097+geireann@users.noreply.github.com> Date: Tue, 3 Nov 2020 11:12:29 +0800 Subject: get pres width differently --- src/client/views/presentationview/PresElementBox.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index b2acad86e..0e10cce47 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -273,9 +273,8 @@ export class PresElementBox extends ViewBoxBaseComponent Date: Tue, 3 Nov 2020 23:32:17 +0800 Subject: remove expand all / minimize all slow performance - especially when the outermost collection is pinned multiple times --- src/client/views/nodes/PresBox.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 699f56620..1d2e6d173 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -1886,15 +1886,14 @@ export class PresBox extends ViewBoxBaseComponent {isMini ? (null) : <>
-
{this._expandBoolean ? "Minimize all" : "Expand all"}
}> + {/*
{this._expandBoolean ? "Minimize all" : "Expand all"}
}>
- {/* */}
-
+
*/}
{presKeyEvents ? "Keys are active" : "Keys are not active - click anywhere on the presentation trail to activate keys"}
}>
-- cgit v1.2.3-70-g09d2 From 7520040052b0943bc5c80d3754335eb869793eb1 Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Wed, 4 Nov 2020 01:29:48 +0800 Subject: fixed presCollection not updating correctly --- src/client/views/nodes/PresBox.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 1d2e6d173..04eda8b90 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -313,14 +313,21 @@ export class PresBox extends ViewBoxBaseComponent navigateToElement = async (curDoc: Doc) => { const activeItem: Doc = this.activeItem; const targetDoc: Doc = this.targetDoc; - const srcContext = await DocCastAsync(targetDoc?.context); + const srcContext = Cast(targetDoc.context, Doc, null); const presCollection = Cast(this.layoutDoc.presCollection, Doc, null); const collectionDocView = presCollection ? DocumentManager.Instance.getDocumentView(presCollection) : undefined; const includesDoc: boolean = DocListCast(presCollection?.data).includes(targetDoc); + const tab = Array.from(CollectionDockingView.Instance.tabMap).find(tab => tab.DashDoc === srcContext); this.turnOffEdit(); + // Handles the setting of presCollection if (includesDoc) { + //Case 1: Pres collection should not change as it is already the same + console.log(1); + } else if (tab !== undefined) { + // Case 2: Pres collection should update + console.log(2); this.layoutDoc.presCollection = srcContext; - } else if (targetDoc) this.layoutDoc.presCollection = targetDoc; + } const presStatus = this.rootDoc.presStatus; const selViewCache = Array.from(this._selectedArray.keys()); const dragViewCache = Array.from(this._dragArray); -- cgit v1.2.3-70-g09d2 From 5372e9b221aa72f7dfa22121ce8a4d85573da8cf Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Wed, 4 Nov 2020 02:47:49 +0800 Subject: reset old width because default width for doc is 400 so max does not work --- src/client/views/EditableView.tsx | 3 ++- src/client/views/collections/CollectionSubView.tsx | 2 +- src/client/views/nodes/PresBox.tsx | 6 ++---- src/client/views/presentationview/PresElementBox.scss | 2 +- src/client/views/presentationview/PresElementBox.tsx | 13 ++++++++----- 5 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index 9606b5a91..ed7a8265f 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -35,6 +35,7 @@ export interface EditableProps { sizeToContent?: boolean; maxHeight?: number; display?: string; + overflow?: string; autosuggestProps?: { resetValue: () => void; value: string, @@ -227,7 +228,7 @@ export class EditableView extends React.Component { setTimeout(() => this.props.autosuggestProps?.resetValue(), 0); return this.props.contents instanceof ObjectField ? (null) :
{ this.props.contents ? this.props.contents?.valueOf() : this.props.placeholder?.valueOf()} diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index f88ebd9ac..b27f64ff0 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -483,7 +483,7 @@ export function CollectionSubView(schemaCtor: (doc: Doc) => T, moreProps?: if (text && !text.includes("https://")) { UndoManager.RunInBatch(() => this.addDocument(Docs.Create.TextDocument(text, { ...options, title: text.substring(0, 20), _width: 400, _height: 315 })), "drop"); } else { - alert("Document updloaded failed - possibly an unsupported file type."); + alert("Document upload failed - possibly an unsupported file type."); } } disposer(); diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 04eda8b90..190af34b9 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -322,10 +322,8 @@ export class PresBox extends ViewBoxBaseComponent // Handles the setting of presCollection if (includesDoc) { //Case 1: Pres collection should not change as it is already the same - console.log(1); } else if (tab !== undefined) { // Case 2: Pres collection should update - console.log(2); this.layoutDoc.presCollection = srcContext; } const presStatus = this.rootDoc.presStatus; @@ -352,10 +350,10 @@ export class PresBox extends ViewBoxBaseComponent if (activeItem.openDocument) { openInTab(); } else if (curDoc.presMovement === PresMovement.Pan && targetDoc) { - await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext, undefined, undefined, undefined, includesDoc ? undefined : resetSelection); // documents open in new tab instead of on right + await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext, undefined, undefined, undefined, includesDoc || tab ? undefined : resetSelection); // documents open in new tab instead of on right } else if ((curDoc.presMovement === PresMovement.Zoom || curDoc.presMovement === PresMovement.Jump) && targetDoc) { //awaiting jump so that new scale can be found, since jumping is async - await DocumentManager.Instance.jumpToDocument(targetDoc, true, openInTab, srcContext, undefined, undefined, undefined, includesDoc ? undefined : resetSelection); // documents open in new tab instead of on right + await DocumentManager.Instance.jumpToDocument(targetDoc, true, openInTab, srcContext, undefined, undefined, undefined, includesDoc || tab ? undefined : resetSelection); // documents open in new tab instead of on right } // After navigating to the document, if it is added as a presPinView then it will // adjust the pan and scale to that of the pinView when it was added. diff --git a/src/client/views/presentationview/PresElementBox.scss b/src/client/views/presentationview/PresElementBox.scss index df5e346e1..73a08b6de 100644 --- a/src/client/views/presentationview/PresElementBox.scss +++ b/src/client/views/presentationview/PresElementBox.scss @@ -42,7 +42,7 @@ $slide-active: #5B9FDD; background-color: #d5dce2; border-radius: 5px; height: calc(100% - 7px); - width: calc(100% - 5px); + width: calc(100% - 15px); display: grid; grid-template-rows: 16px 10px auto; grid-template-columns: max-content max-content max-content max-content auto; diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index 0e10cce47..7b4afeb69 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -273,15 +273,17 @@ export class PresElementBox extends ViewBoxBaseComponent= 300; - const miniView: boolean = this.toolbarWidth <= 100; + const miniView: boolean = this.toolbarWidth <= 110; const targetDoc: Doc = this.targetDoc; const activeItem: Doc = this.rootDoc; return ( @@ -311,11 +313,12 @@ export class PresElementBox extends ViewBoxBaseComponent} {miniView ? (null) :
-
+
StrCast(activeItem.title)} SetValue={this.onSetValue} /> @@ -344,7 +347,7 @@ export class PresElementBox extends ViewBoxBaseComponent e.stopPropagation()} />
-
{activeItem.presPinView ? (<>View of {targetDoc.title}) : targetDoc.title}
+
{activeItem.presPinView ? (<>View of {targetDoc.title}) : targetDoc.title}
{this.renderEmbeddedInline}
}
); -- cgit v1.2.3-70-g09d2