From 10935eb271443bd390d6b27b616bfcfef4ad01b2 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 25 Oct 2020 11:03:39 -0400 Subject: fixed updating pres.box instance and selectedArray to trigger mobx updates properluy --- src/client/views/presentationview/PresElementBox.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/client/views/presentationview/PresElementBox.tsx') diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index 0dc8a2148..2d7a768cc 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -141,8 +141,8 @@ export class PresElementBox extends ViewBoxBaseComponent { @@ -171,7 +171,7 @@ export class PresElementBox extends ViewBoxBaseComponent= 1) { const doc = document.createElement('div'); doc.className = "presItem-multiDrag"; - doc.innerText = "Move " + PresBox.Instance._selectedArray.length + " slides"; + doc.innerText = "Move " + PresBox.Instance._selectedArray.size + " slides"; doc.style.position = 'absolute'; doc.style.top = (e.clientY) + 'px'; doc.style.left = (e.clientX - 50) + 'px'; @@ -226,8 +226,8 @@ export class PresElementBox extends ViewBoxBaseComponent { this.props.removeDocument?.(this.rootDoc); - if (PresBox.Instance._selectedArray.includes(this.rootDoc)) { - PresBox.Instance._selectedArray.splice(PresBox.Instance._selectedArray.indexOf(this.rootDoc), 1); + if (PresBox.Instance._selectedArray.has(this.rootDoc)) { + PresBox.Instance._selectedArray.delete(this.rootDoc); } e.stopPropagation(); }); @@ -275,7 +275,7 @@ export class PresElementBox extends ViewBoxBaseComponent= 300; const miniView: boolean = this.toolbarWidth <= 100; -- cgit v1.2.3-70-g09d2