From 1dfcd3e43587255dd5103cefc472d6f6f1971127 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 28 Feb 2021 14:44:44 -0500 Subject: Fix missing details causing frequency tags to not be clickable (#1467) --- ext/js/display/display-generator.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ext/js/display') 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; } -- cgit v1.2.3