aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PresBox.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-03 02:58:31 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-03 02:58:31 +0800
commit8303cd6389fe9e3c861d7b429bb4e32d3417a895 (patch)
treeb786c5ab7bfec2fd73724d338215b26e05502dc6 /src/client/views/nodes/PresBox.tsx
parentd60b2a6857c8d02877e482a3ecd44126348abf26 (diff)
Merge remote-tracking branch 'origin/menu_restructure' into presentation_updates
Diffstat (limited to 'src/client/views/nodes/PresBox.tsx')
-rw-r--r--src/client/views/nodes/PresBox.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index c04c6c409..97f223c02 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -32,6 +32,7 @@ import { conformsTo } from "lodash";
import { translate } from "googleapis/build/src/apis/translate";
import { DragManager, dropActionType } from "../../util/DragManager";
import { actionAsync } from "mobx-utils";
+import { SelectionManager } from "../../util/SelectionManager";
type PresBoxSchema = makeInterface<[typeof documentSchema]>;
const PresBoxDocument = makeInterface(documentSchema);
@@ -260,7 +261,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
const targetDoc = Cast(activeItem.presentationTargetDoc, Doc, null);
const srcContext = await DocCastAsync(targetDoc.context);
const presCollection = Cast(this.layoutDoc.presCollection, Doc, null);
- const collectionDocView = presCollection ? DocumentManager.Instance.getDocumentView(presCollection) : undefined;
+ const collectionDocView = presCollection ? await DocumentManager.Instance.getDocumentView(presCollection) : undefined;
if (this.itemIndex >= 0) {
if (targetDoc) {
if (srcContext) this.layoutDoc.presCollection = srcContext;
@@ -496,6 +497,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
selectElement = (doc: Doc) => {
// this._selectedArray = [];
this.gotoDocument(this.childDocs.indexOf(doc), NumCast(this.itemIndex));
+ const view = DocumentManager.Instance.getDocumentView(doc);
+ view && SelectionManager.SelectDoc(view, false);
// this._selectedArray.push(this.childDocs[this.childDocs.indexOf(doc)]);
// console.log(this._selectedArray);
}
@@ -504,8 +507,9 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
@action
multiSelect = (doc: Doc, ref: HTMLElement) => {
this._selectedArray.push(this.childDocs[this.childDocs.indexOf(doc)]);
- const ele = ref.getElementsByClassName("stacking");
this._eleArray.push(ref);
+ const view = DocumentManager.Instance.getDocumentView(doc);
+ view && SelectionManager.SelectDoc(view, true);
}
//Shift click
@@ -517,6 +521,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
for (let i = Math.min(this.itemIndex, this.childDocs.indexOf(doc)); i <= Math.max(this.itemIndex, this.childDocs.indexOf(doc)); i++) {
this._selectedArray.push(this.childDocs[i]);
this._eleArray.push(ref);
+ const view = DocumentManager.Instance.getDocumentView(doc);
+ view && SelectionManager.SelectDoc(view, true);
}
}
}