From b687870a55eae43a71ea3adc41be0ab341a8721f Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 8 Sep 2020 19:40:15 -0400 Subject: Delay hide option (#774) * Add hideDelay option * Add _clearSelection * Use hideDelay * Prevent repeated delayed selection clears * Fix popup hide timer being cleared when the cursor is moved into the frame --- ext/mixed/js/text-scanner.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/mixed') diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js index 2410f2b7..f3e99577 100644 --- a/ext/mixed/js/text-scanner.js +++ b/ext/mixed/js/text-scanner.js @@ -144,6 +144,10 @@ class TextScanner extends EventDispatcher { return clonedTextSource.text(); } + hasSelection() { + return (this._textSourceCurrent !== null); + } + clearSelection(passive) { if (!this._canClearSelection) { return; } if (this._textSourceCurrent !== null) { -- cgit v1.2.3