aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-08-08 21:32:51 -0700
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-08-08 21:32:51 -0700
commit98d753d5dd66a646f00bcdf15656f845cd27fb81 (patch)
tree402eda69cf59fb9a85814f02f57a1ff3862abbb8 /src/client/views/nodes/DocumentView.tsx
parent25fa93e7060c8f8561c294c7309c763e3b8f9313 (diff)
parent9f4a7ec5f79d9dec3a0ffb0b633197216cbefec8 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into new_audio
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 444583af3..47e1b2715 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -565,12 +565,23 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
}
}
- @undoBatch
+ @undoBatch @action
deleteClicked = (): void => {
if (Doc.UserDoc().activeWorkspace === this.props.Document) {
alert("Can't delete the active workspace");
} else {
+ const recent = Cast(Doc.UserDoc().myRecentlyClosed, Doc) as Doc;
+ const selected = SelectionManager.SelectedDocuments().slice();
SelectionManager.DeselectAll();
+
+ selected.map(dv => {
+ const effectiveAcl = GetEffectiveAcl(dv.props.Document);
+ if (effectiveAcl === AclEdit || effectiveAcl === AclAdmin) { // deletes whatever you have the right to delete
+ recent && Doc.AddDocToList(recent, "data", dv.props.Document, undefined, true, true);
+ dv.props.removeDocument?.(dv.props.Document);
+ }
+ });
+
this.props.Document.deleted = true;
this.props.removeDocument?.(this.props.Document);
}