From 99b63e35ddf40fc1a69d50059b72275ce23ac43e Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 21 Feb 2023 10:04:34 -0500 Subject: from last - fixes to showing doc decorations when pointer leaves selection box. --- src/client/views/DocumentDecorations.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 21f63ada4..c3ef7570b 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -66,7 +66,19 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P DocumentDecorations.Instance = this; reaction( () => SelectionManager.Views().slice(), - action(docs => (this._editingTitle = false)) + action(docs => { + docs.length > 1 && (this._showNothing = false); // show decorations if multiple docs are selected + this._editingTitle = false; + }) + ); + document.addEventListener( + // show decorations whenever pointer moves outside of selection bounds. + 'pointermove', + action(e => { + if (this.Bounds.x !== Number.MAX_VALUE && (this.Bounds.x > e.clientX || this.Bounds.r < e.clientX || this.Bounds.y > e.clientY || this.Bounds.b < e.clientY)) { + this._showNothing = false; + } + }) ); } @@ -816,7 +828,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P ); return ( -
(this._showNothing = false))}> +