summaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-31 14:21:50 -0500
committerGitHub <noreply@github.com>2020-12-31 14:21:50 -0500
commit889240311b4072021f3742345bc87118c5b3a3e1 (patch)
tree1fdf2b476092569549e2dbd0c88c5b45aea13a70 /ext/mixed/js/display.js
parent1b4ba1fb006a6e6dda7f19c797b204c43900df4a (diff)
Improve tag scanning behaviour (#1189)
* Update include/exclude selectors for Display._definitionTextScanner * Fix missing condition
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index c0d84dce..3817559d 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -845,6 +845,7 @@ class Display extends EventDispatcher {
_showTagNotification(content) {
if (this._tagNotification === null) {
const node = this._displayGenerator.createEmptyFooterNotification();
+ node.classList.add('click-scannable');
this._tagNotification = new DisplayNotification(this._tagNotificationContainer, node);
}
@@ -1792,8 +1793,8 @@ class Display extends EventDispatcher {
searchOnClick: true,
searchOnClickOnly: true
});
- const excludeSelectors = ['.scan-disable', '.scan-disable *'];
- this._definitionTextScanner.excludeSelector = excludeSelectors.join(',');
+ this._definitionTextScanner.includeSelector = '.click-scannable,.click-scannable *';
+ this._definitionTextScanner.excludeSelector = '.scan-disable,.scan-disable *';
this._definitionTextScanner.prepare();
this._definitionTextScanner.on('searched', this._onDefinitionTextScannerSearched.bind(this));
}
@@ -1825,9 +1826,6 @@ class Display extends EventDispatcher {
preventMiddleMouse: false
});
- const includeSelector = '.term-glossary-item,.term-glossary-item *,.tag,.tag *';
- this._definitionTextScanner.includeSelector = includeSelector;
-
this._definitionTextScanner.setEnabled(true);
}