aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display
diff options
context:
space:
mode:
authorKuuuube <61125188+Kuuuube@users.noreply.github.com>2024-05-28 15:32:56 -0400
committerGitHub <noreply@github.com>2024-05-28 19:32:56 +0000
commit3bfd56bbe46a4f2ee9c66f0c7baeec3c6292718c (patch)
tree668f8ce77c043308ad4d6c57911931ef03565bf1 /ext/js/display
parentb414e3f1fa351c0754b1fc9e0ee33bef7e1962d3 (diff)
Fix clipboard monitor in popups (#1003)
* Fix naming of _clipboardReaderLike * Allow clipboard monitors in popup searches * Only run _onClipboardTextChange if a search tab does not exist
Diffstat (limited to 'ext/js/display')
-rw-r--r--ext/js/display/search-display-controller.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/js/display/search-display-controller.js b/ext/js/display/search-display-controller.js
index 815c51c9..62dbf343 100644
--- a/ext/js/display/search-display-controller.js
+++ b/ext/js/display/search-display-controller.js
@@ -66,11 +66,11 @@ export class SearchDisplayController {
/** @type {boolean} */
this._clipboardMonitorEnabled = false;
/** @type {import('clipboard-monitor').ClipboardReaderLike} */
- this.clipboardReaderLike = {
+ this._clipboardReaderLike = {
getText: this._display.application.api.clipboardGet.bind(this._display.application.api)
};
/** @type {ClipboardMonitor} */
- this._clipboardMonitor = new ClipboardMonitor(this.clipboardReaderLike);
+ this._clipboardMonitor = new ClipboardMonitor(this._clipboardReaderLike);
/** @type {import('application').ApiMap} */
this._apiMap = createApiMap([
['searchDisplayControllerGetMode', this._onMessageGetMode.bind(this)],
@@ -271,7 +271,7 @@ export class SearchDisplayController {
/** */
async _onCopy() {
// Ignore copy from search page
- this._clipboardMonitor.setPreviousText(document.hasFocus() ? await this.clipboardReaderLike.getText(false) : '');
+ this._clipboardMonitor.setPreviousText(document.hasFocus() ? await this._clipboardReaderLike.getText(false) : '');
}
/** @type {import('application').ApiHandler<'searchDisplayControllerUpdateSearchQuery'>} */
@@ -498,7 +498,6 @@ export class SearchDisplayController {
*/
_canEnableClipboardMonitor() {
switch (this._searchPersistentStateController.mode) {
- case 'popup':
case 'action-popup':
return false;
default: