aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 0e9bf50fc..b666b5977 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -153,29 +153,29 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
_deleteAfterIconify = false;
_iconifyBatch: UndoManager.Batch | undefined;
onCloseClick = (forceDeleteOrIconify: boolean | undefined) => {
- if (this.canDelete) {
- const views = SelectionManager.Views().slice().filter(v => v);
- if (forceDeleteOrIconify === false && this._iconifyBatch) return;
- this._deleteAfterIconify = forceDeleteOrIconify || this._iconifyBatch ? true : false;
- if (!this._iconifyBatch) {
- this._iconifyBatch = UndoManager.StartBatch("iconifying");
- } else {
- forceDeleteOrIconify = false; // can't force immediate close in the middle of iconifying -- have to wait until iconifying completes
- }
- var iconifyingCount = views.length;
- const finished = action((force?: boolean) => {
- if ((force || --iconifyingCount === 0) && this._iconifyBatch) {
- if (this._deleteAfterIconify) {
- views.forEach(iconView => iconView.props.removeDocument?.(iconView.props.Document));
- SelectionManager.DeselectAll();
- }
- this._iconifyBatch?.end();
- this._iconifyBatch = undefined;
- }
- });
- if (forceDeleteOrIconify) finished(forceDeleteOrIconify);
- else if (!this._deleteAfterIconify) views.forEach(dv => dv.iconify(finished));
+
+ const views = SelectionManager.Views().slice().filter(v => v);
+ if (forceDeleteOrIconify === false && this._iconifyBatch) return;
+ this._deleteAfterIconify = forceDeleteOrIconify || this._iconifyBatch ? true : false;
+ if (!this._iconifyBatch) {
+ this._iconifyBatch = UndoManager.StartBatch("iconifying");
+ } else {
+ forceDeleteOrIconify = false; // can't force immediate close in the middle of iconifying -- have to wait until iconifying completes
}
+ var iconifyingCount = views.length;
+ const finished = action((force?: boolean) => {
+ if ((force || --iconifyingCount === 0) && this._iconifyBatch) {
+ if (this._deleteAfterIconify) {
+ views.forEach(iconView => iconView.props.removeDocument?.(iconView.props.Document));
+ SelectionManager.DeselectAll();
+ }
+ this._iconifyBatch?.end();
+ this._iconifyBatch = undefined;
+ }
+ });
+ if (forceDeleteOrIconify) finished(forceDeleteOrIconify);
+ else if (!this._deleteAfterIconify) views.forEach(dv => dv.iconify(finished));
+
}
onMaximizeDown = (e: React.PointerEvent) => {
setupMoveUpEvents(this, e, () => {