Fix search tags in split and grouped display modes (#1412)
This commit is contained in:
parent
6fc5eb2ae1
commit
53d02ca3d3
@ -973,6 +973,9 @@ button.action-button[data-icon=source-term]::before {
|
|||||||
bottom: -0.5em;
|
bottom: -0.5em;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
.entry[data-type=term][data-expression-multi=true] .term-tags>.tag[data-category=search] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Definitions */
|
/* Definitions */
|
||||||
|
@ -70,7 +70,8 @@ class DisplayGenerator {
|
|||||||
|
|
||||||
const uniqueExpressions = new Set();
|
const uniqueExpressions = new Set();
|
||||||
const uniqueReadings = 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);
|
uniqueExpressions.add(expression);
|
||||||
uniqueReadings.add(reading);
|
uniqueReadings.add(reading);
|
||||||
}
|
}
|
||||||
@ -92,6 +93,14 @@ class DisplayGenerator {
|
|||||||
this._appendMultiple(pitchesContainer, this._createPitches.bind(this), pitches);
|
this._appendMultiple(pitchesContainer, this._createPitches.bind(this), pitches);
|
||||||
this._appendMultiple(termTagsContainer, this._createTermTag.bind(this), termTags, expressions.length);
|
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
|
// Add definitions
|
||||||
const dictionaryTag = this._createDictionaryTag(null);
|
const dictionaryTag = this._createDictionaryTag(null);
|
||||||
for (let i = 0, ii = definitions.length; i < ii; ++i) {
|
for (let i = 0, ii = definitions.length; i < ii; ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user