Update search tags to always be displayed in a consistent manner (#1645)

This commit is contained in:
toasted-nutbread 2021-05-01 11:53:56 -04:00 committed by GitHub
parent 8ee470caa0
commit c433819c1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 20 deletions

View File

@ -879,9 +879,6 @@ button.action-button[data-icon=source-term]::before {
.headword-details {
display: inline;
}
.headword-tag-list {
display: none;
}
.headword-list-details {
display: inline;
}
@ -1103,16 +1100,6 @@ button.action-button[data-icon=source-term]::before {
:root:not([data-result-output-mode=merge]) .headword-list .headword-details>.action-play-audio {
display: none;
}
:root[data-result-output-mode=merge] .headword-list .headword-tag-list {
display: block;
position: absolute;
left: 0;
bottom: -0.5em;
white-space: nowrap;
}
:root[data-result-output-mode=merge] .entry[data-type=term] .headword-list-tag-list>.tag[data-category=search] {
display: none;
}
/* Definitions */

View File

@ -43,7 +43,6 @@
</div>
<div class="headword-details">
<button class="action-button action-play-audio" data-icon="play-audio" title="Play audio" data-title-default="Play audio" data-hotkey='["playAudio",["title","data-title-default"],"Play audio ({0})"]' data-menu-position="right below h-cover v-cover"><div class="action-button-badge icon" hidden></div></button>
<div class="headword-tag-list tag-list"></div>
</div>
</div></template>
<template id="definition-item-template" data-remove-whitespace-text="true"><li class="definition-item">

View File

@ -238,14 +238,9 @@ class DisplayGenerator {
_createTermHeadword(headword, headwordIndex, pronunciations) {
const {term, reading, tags} = headword;
const searchQueries = [];
if (term) { searchQueries.push(term); }
if (reading) { searchQueries.push(reading); }
const node = this._templates.instantiate('headword');
const termContainer = node.querySelector('.headword-term');
const tagContainer = node.querySelector('.headword-tag-list');
node.dataset.readingIsSame = `${reading === term}`;
node.dataset.frequency = DictionaryDataUtil.getTermFrequency(tags);
@ -262,7 +257,6 @@ class DisplayGenerator {
this._setTextContent(node.querySelector('.headword-reading'), reading);
this._appendFurigana(termContainer, term, reading, this._appendKanjiLinks.bind(this));
this._appendMultiple(tagContainer, this._createSearchTag.bind(this), searchQueries);
return node;
}