From 94d63f4f87a61f7e42ea44d8100ea11d5ccdbce0 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 27 Nov 2020 15:22:06 -0500 Subject: Display style updates (#1072) * Add variables for tag styles * Add variable for compact list separator * Improve compactness of pitch accents * Improve kanji link styles * Improve coloring for lists * Move styles * Update styles for lists * Move conditional styles * Simplify definitions * Remove unused styles * Cleanup * Use strings for dataset properties * Don't always collapse pitch accents --- ext/mixed/js/display-generator.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ext/mixed/js') diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js index 0cf1e8c6..63140330 100644 --- a/ext/mixed/js/display-generator.js +++ b/ext/mixed/js/display-generator.js @@ -311,7 +311,7 @@ class DisplayGenerator { node.title = details.notes; inner.textContent = details.name; node.dataset.category = details.category; - if (details.redundant) { node.dataset.redundant = true; } + if (details.redundant) { node.dataset.redundant = 'true'; } return node; } @@ -338,7 +338,16 @@ class DisplayGenerator { const tag = this._createTag({notes: '', name: dictionary, category: 'pitch-accent-dictionary'}); node.querySelector('.term-pitch-accent-group-tag-list').appendChild(tag); + let hasTags = false; + for (const {tags} of pitches) { + if (tags.length > 0) { + hasTags = true; + break; + } + } + const n = node.querySelector('.term-pitch-accent-list'); + n.dataset.hasTags = `${hasTags}`; this._appendMultiple(n, this._createPitch.bind(this), pitches); return node; -- cgit v1.2.3