summaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-09 22:35:26 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-09 22:40:25 -0400
commit06183ec12442fc127a7f723225bcf1782eb15ebc (patch)
treea90acb6c00352f2934b9a290d2f1a30f53c5bc15 /ext/mixed/js
parentbb37b74288cf0653f42bbb149e3c563adcf2ead5 (diff)
Update how termTags is passed to _createTermExpression
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/display-generator.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js
index 6ae727e0..b2d34cfc 100644
--- a/ext/mixed/js/display-generator.js
+++ b/ext/mixed/js/display-generator.js
@@ -68,9 +68,9 @@ class DisplayGenerator {
const termTags = details.termTags;
let expressions = details.expressions;
- expressions = Array.isArray(expressions) ? expressions.map((e) => [e, termTags]) : [[details, termTags]];
+ expressions = Array.isArray(expressions) ? expressions : [details];
- this._appendMultiple(expressionsContainer, this._createTermExpression.bind(this), expressions);
+ this._appendMultiple(expressionsContainer, this._createTermExpression.bind(this), expressions, termTags);
this._appendMultiple(reasonsContainer, this._createTermReason.bind(this), details.reasons);
this._appendMultiple(frequenciesContainer, this._createFrequencyTag.bind(this), details.frequencies);
this._appendMultiple(pitchesContainer, this._createPitches.bind(this), pitches);
@@ -130,7 +130,7 @@ class DisplayGenerator {
// Private
- _createTermExpression([details, termTags]) {
+ _createTermExpression(details, termTags) {
const node = this._templateHandler.instantiate('term-expression');
const expressionContainer = node.querySelector('.term-expression-text');
@@ -455,11 +455,11 @@ class DisplayGenerator {
);
}
- _appendMultiple(container, createItem, detailsIterable) {
+ _appendMultiple(container, createItem, detailsIterable, ...args) {
let count = 0;
if (container !== null && this._isIterable(detailsIterable)) {
for (const details of detailsIterable) {
- const item = createItem(details);
+ const item = createItem(details, ...args);
if (item === null) { continue; }
container.appendChild(item);
++count;