summaryrefslogtreecommitdiff
path: root/ext/mixed/js/display-generator.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-21 21:17:39 -0500
committerGitHub <noreply@github.com>2020-11-21 21:17:39 -0500
commit7b6a4c4e36ce65af376cd87f5f9e7c657ef2a12c (patch)
treec5fad23e1f1aa689958fbfab8cd8ffbaea7c0b64 /ext/mixed/js/display-generator.js
parentaf33fff6fb10f77eb08b0bce572a18c2bff6c846 (diff)
More display updates (#1050)
* Use grid for layout * Add data-count attribute * Fix scroll issues during focus * Add index to entries * Simplify audio playback
Diffstat (limited to 'ext/mixed/js/display-generator.js')
-rw-r--r--ext/mixed/js/display-generator.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js
index 5a563024..e90d003a 100644
--- a/ext/mixed/js/display-generator.js
+++ b/ext/mixed/js/display-generator.js
@@ -473,11 +473,15 @@ class DisplayGenerator {
_appendMultiple(container, createItem, detailsArray, ...args) {
let count = 0;
+ const {ELEMENT_NODE} = Node;
if (Array.isArray(detailsArray)) {
for (const details of detailsArray) {
const item = createItem(details, ...args);
if (item === null) { continue; }
container.appendChild(item);
+ if (item.nodeType === ELEMENT_NODE) {
+ item.dataset.index = `${count}`;
+ }
++count;
}
}