aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display-generator.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-16 21:33:58 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-16 22:39:26 -0500
commit9abfd7acde5c917f70db9f2d9e04148862102f57 (patch)
tree9a40b73ac1b7585883119a1c14039dfc79aa7f14 /ext/mixed/js/display-generator.js
parent6c344b2740ae7ef0bc214d1391c1592d802434ac (diff)
Always show actions when there is only a single term result
Diffstat (limited to 'ext/mixed/js/display-generator.js')
-rw-r--r--ext/mixed/js/display-generator.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js
index 8eb699e0..63e7a8b5 100644
--- a/ext/mixed/js/display-generator.js
+++ b/ext/mixed/js/display-generator.js
@@ -63,11 +63,13 @@ class DisplayGenerator {
const definitionsContainer = node.querySelector('.term-definition-list');
const debugInfoContainer = node.querySelector('.debug-info');
- const multiExpression = Array.isArray(details.expressions);
- const multiDefinition = Array.isArray(details.definitions);
+ const expressionMulti = Array.isArray(details.expressions);
+ const definitionMulti = Array.isArray(details.definitions);
- node.dataset.multiExpression = `${multiExpression}`;
- node.dataset.multiDefinition = `${multiDefinition}`;
+ node.dataset.expressionMulti = `${expressionMulti}`;
+ node.dataset.definitionMulti = `${definitionMulti}`;
+ node.dataset.expressionCount = `${expressionMulti ? details.expressions.length : 1}`;
+ node.dataset.definitionCount = `${definitionMulti ? details.definitions.length : 1}`;
DisplayGenerator._appendMultiple(expressionsContainer, this.createTermExpression.bind(this), details.expressions, [details]);
DisplayGenerator._appendMultiple(reasonsContainer, this.createTermReason.bind(this), details.reasons);