aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-04-29 17:38:06 -0400
committerbobzel <zzzman@gmail.com>2022-04-29 17:38:06 -0400
commit55a5322fffc09bde04ef8b466e19b701bad2762b (patch)
treed39e55336405bd4d79bd26b150ba5caf052d6fef /src/client/views/DocumentDecorations.tsx
parenta6aec8759298fba41b486a973796662056f47da0 (diff)
added 'enter' to toggle iconify. fixed webBox deiconify to render webpage. updated colors in minimap to match icon colors.
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 1feb643df..fb8cfbc15 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -146,14 +146,15 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
_deleteAfterIconify = false;
_iconifyBatch: UndoManager.Batch | undefined;
- onCloseClick = (force = false) => {
+ onCloseClick = (forceDeleteOrIconify: boolean | undefined) => {
if (this.canDelete) {
const views = SelectionManager.Views().slice().filter(v => v);
- this._deleteAfterIconify = force || this._iconifyBatch ? true : false;
+ if (forceDeleteOrIconify === false && this._iconifyBatch) return;
+ this._deleteAfterIconify = forceDeleteOrIconify || this._iconifyBatch ? true : false;
if (!this._iconifyBatch) {
this._iconifyBatch = UndoManager.StartBatch("iconifying");
} else {
- force = false; // can't force immediate close in the middle of iconifying -- have to wait until iconifying completes
+ 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) => {
@@ -166,7 +167,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
this._iconifyBatch = undefined;
}
});
- if (force) finished(force);
+ if (forceDeleteOrIconify) finished(forceDeleteOrIconify);
else if (!this._deleteAfterIconify) views.forEach(dv => dv.iconify(finished));
}
}
@@ -531,7 +532,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
left: bounds.x - this._resizeBorderWidth / 2,
top: bounds.y - this._resizeBorderWidth / 2 - this._titleHeight,
}}>
- {!canDelete ? <div /> : topBtn("close", this.hasIcons ? "times" : "window-maximize", undefined, e => this.onCloseClick(this.hasIcons), "Close")}
+ {!canDelete ? <div /> : topBtn("close", this.hasIcons ? "times" : "window-maximize", undefined, e => this.onCloseClick(this.hasIcons ? true : undefined), "Close")}
{titleArea}
{!canOpen ? (null) : topBtn("open", "external-link-alt", this.onMaximizeDown, undefined, "Open in Tab (ctrl: as alias, shift: in new collection)")}
{hideResizers ? (null) :