summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/css/display.css3
-rw-r--r--ext/js/display/display-generator.js11
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/css/display.css b/ext/css/display.css
index 7953f6ef..9cd5c5ac 100644
--- a/ext/css/display.css
+++ b/ext/css/display.css
@@ -973,6 +973,9 @@ button.action-button[data-icon=source-term]::before {
bottom: -0.5em;
white-space: nowrap;
}
+.entry[data-type=term][data-expression-multi=true] .term-tags>.tag[data-category=search] {
+ display: none;
+}
/* Definitions */
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index 1b3908fe..d02e2d9c 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -70,7 +70,8 @@ class DisplayGenerator {
const uniqueExpressions = new Set();
const uniqueReadings = new Set();
- for (const {expression, reading} of expressions) {
+ for (let {expression, reading} of expressions) {
+ if (reading.length === 0) { reading = expression; }
uniqueExpressions.add(expression);
uniqueReadings.add(reading);
}
@@ -92,6 +93,14 @@ class DisplayGenerator {
this._appendMultiple(pitchesContainer, this._createPitches.bind(this), pitches);
this._appendMultiple(termTagsContainer, this._createTermTag.bind(this), termTags, expressions.length);
+ for (const expression of uniqueExpressions) {
+ termTagsContainer.appendChild(this._createSearchTag(expression));
+ }
+ for (const reading of uniqueReadings) {
+ if (uniqueExpressions.has(reading)) { continue; }
+ termTagsContainer.appendChild(this._createSearchTag(reading));
+ }
+
// Add definitions
const dictionaryTag = this._createDictionaryTag(null);
for (let i = 0, ii = definitions.length; i < ii; ++i) {