diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-11-27 15:22:06 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-27 15:22:06 -0500 | 
| commit | 94d63f4f87a61f7e42ea44d8100ea11d5ccdbce0 (patch) | |
| tree | a06b8500c9fe839f4ccc7588a40910c9b1de0eac /ext/mixed/js | |
| parent | 8449322e1c7b083e1096b8168abf162730880f89 (diff) | |
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
Diffstat (limited to 'ext/mixed/js')
| -rw-r--r-- | ext/mixed/js/display-generator.js | 11 | 
1 files changed, 10 insertions, 1 deletions
| 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; |