diff options
author | bobzel <zzzman@gmail.com> | 2023-02-21 10:04:34 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-02-21 10:04:34 -0500 |
commit | 99b63e35ddf40fc1a69d50059b72275ce23ac43e (patch) | |
tree | 80f619ad1bb5eaf1a3634018b71ec1e5ed4e39d7 /src | |
parent | f303131b40fac4909ab2730b369ef3bdb8e00b1d (diff) |
from last - fixes to showing doc decorations when pointer leaves selection box.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/DocumentDecorations.tsx | 16 |
1 files changed, 14 insertions, 2 deletions
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 </div> ); return ( - <div className={`documentDecorations${colorScheme}`} style={{ opacity: this._showNothing ? 0.1 : undefined }} onPointerOver={action(e => (this._showNothing = false))}> + <div className={`documentDecorations${colorScheme}`} style={{ opacity: this._showNothing ? 0.1 : undefined }}> <div className="documentDecorations-background" style={{ |