diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-03-01 14:04:54 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-03-28 10:25:57 -0400 |
commit | 9e8a22b08a9ea3e746c4c16f0a06beabd2dd7294 (patch) | |
tree | d177db7a98b7327837d0a39a4850b84ae0a1bfd5 /ext/mixed/js | |
parent | 168bd72d0a5289646c78c57f6f36fe2aa1a194eb (diff) |
Add support for different sections for term content
Diffstat (limited to 'ext/mixed/js')
-rw-r--r-- | ext/mixed/js/display-generator.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js index d88b8648..e9cdd998 100644 --- a/ext/mixed/js/display-generator.js +++ b/ext/mixed/js/display-generator.js @@ -43,11 +43,17 @@ class DisplayGenerator { const expressionMulti = Array.isArray(details.expressions); const definitionMulti = Array.isArray(details.definitions); + const expressionCount = expressionMulti ? details.expressions.length : 1; + const definitionCount = definitionMulti ? details.definitions.length : 1; node.dataset.expressionMulti = `${expressionMulti}`; node.dataset.definitionMulti = `${definitionMulti}`; - node.dataset.expressionCount = `${expressionMulti ? details.expressions.length : 1}`; - node.dataset.definitionCount = `${definitionMulti ? details.definitions.length : 1}`; + node.dataset.expressionCount = `${expressionCount}`; + node.dataset.definitionCount = `${definitionCount}`; + + bodyContainer.dataset.sectionCount = `${ + (definitionCount > 0 ? 1 : 0) + }`; const termTags = details.termTags; let expressions = details.expressions; |