summaryrefslogtreecommitdiff
path: root/ext/js/display
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display')
-rw-r--r--ext/js/display/display-generator.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index 93e84bdd..d8ae566e 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -70,8 +70,7 @@ class DisplayGenerator {
const uniqueExpressions = new Set();
const uniqueReadings = new Set();
- for (let {expression, reading} of expressions) {
- if (reading.length === 0) { reading = expression; }
+ for (const {expression, reading} of expressions) {
uniqueExpressions.add(expression);
uniqueReadings.add(reading);
}
@@ -244,7 +243,7 @@ class DisplayGenerator {
const expressionContainer = node.querySelector('.expression-text');
const tagContainer = node.querySelector('.expression-tag-list');
- node.dataset.readingIsSame = `${!reading || reading === expression}`;
+ node.dataset.readingIsSame = `${reading === expression}`;
node.dataset.frequency = termFrequency;
const pitchAccentCategories = this._getPitchAccentCategories(pitches);
@@ -252,7 +251,7 @@ class DisplayGenerator {
node.dataset.pitchAccentCategories = pitchAccentCategories;
}
- this._setTextContent(node.querySelector('.expression-reading'), reading.length > 0 ? reading : expression);
+ this._setTextContent(node.querySelector('.expression-reading'), reading);
this._appendFurigana(expressionContainer, furiganaSegments, this._appendKanjiLinks.bind(this));
this._appendMultiple(tagContainer, this._createTag.bind(this), termTags);