diff options
author | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-08-08 21:32:51 -0700 |
---|---|---|
committer | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-08-08 21:32:51 -0700 |
commit | 98d753d5dd66a646f00bcdf15656f845cd27fb81 (patch) | |
tree | 402eda69cf59fb9a85814f02f57a1ff3862abbb8 /src/client/views/nodes/DocumentView.tsx | |
parent | 25fa93e7060c8f8561c294c7309c763e3b8f9313 (diff) | |
parent | 9f4a7ec5f79d9dec3a0ffb0b633197216cbefec8 (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.tsx | 13 |
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); } |