Skip to content

Commit 03c245b

Browse files
committed
17.0 RC3: hotfix gti indexing
1 parent 03765c3 commit 03c245b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/static/js/app/gti.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ window.addEventListener('scroll', () => {
4848

4949
function recalc() {
5050
let i = 1;
51-
document.querySelectorAll('.question').forEach((q) => {
52-
q.innerHTML = `<span class="number">${i++}.</span> ${q.innerHTML}`; // add index to each question title
51+
document.querySelectorAll('.question-block').forEach((q) => {
52+
let title = q.querySelector('.question');
53+
title.innerHTML = `<span class="number">${i++}.</span> ${title.innerHTML}`; // add index to each question title
5354

5455
let j = 0;
55-
block.querySelectorAll('.answer').forEach((ans) => { // for each answer
56+
q.querySelectorAll('.answer').forEach((ans) => { // for each answer
5657
let letter = String.fromCharCode(97 + j++); // convert index to letter
5758
ans.innerHTML = `<span class="letter">${letter}.</span>${ans.innerHTML}`; // add letter to answer
5859
});

0 commit comments

Comments
 (0)