diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-02-28 14:44:44 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-28 14:44:44 -0500 | 
| commit | 1dfcd3e43587255dd5103cefc472d6f6f1971127 (patch) | |
| tree | 09a9635f51e45b3c7033dfc95cc29ca272a37212 /ext/js | |
| parent | 704db45e29287718cbfbe7b0a4a2c261aef8a71d (diff) | |
Fix missing details causing frequency tags to not be clickable (#1467)
Diffstat (limited to 'ext/js')
| -rw-r--r-- | ext/js/display/display-generator.js | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js index 1d824507..bd0c83a2 100644 --- a/ext/js/display/display-generator.js +++ b/ext/js/display/display-generator.js @@ -164,7 +164,11 @@ class DisplayGenerator {      createTagFooterNotificationDetails(tagNode) {          const node = this._templates.instantiateFragment('footer-notification-tag-details'); -        const details = tagNode.dataset.details; +        let details = tagNode.dataset.details; +        if (typeof details !== 'string') { +            const label = tagNode.querySelector('.tag-label-content'); +            details = label !== null ? label.textContent : ''; +        }          this._setTextContent(node.querySelector('.tag-details'), details);          let disambiguation = null; @@ -602,6 +606,7 @@ class DisplayGenerator {          body.dataset.count = `${frequencyData.length}`;          node.dataset.count = `${frequencyData.length}`; +        node.dataset.details = dictionary;          return node;      } @@ -624,6 +629,7 @@ class DisplayGenerator {          node.dataset.readingIsSame = `${reading === expression}`;          node.dataset.dictionary = dictionary;          node.dataset.frequency = `${frequency}`; +        node.dataset.details = dictionary;          return node;      } @@ -640,6 +646,7 @@ class DisplayGenerator {          node.dataset.character = character;          node.dataset.dictionary = dictionary;          node.dataset.frequency = `${frequency}`; +        node.dataset.details = dictionary;          return node;      } |