Omar ID EL MOUMEN commited on
Commit
959f2b1
·
1 Parent(s): ad1e294

Mini-patch #3

Browse files
Files changed (1) hide show
  1. static/script.js +4 -4
static/script.js CHANGED
@@ -163,15 +163,15 @@ document.addEventListener('DOMContentLoaded', function() {
163
  }
164
  let t = "";
165
  if(Array.isArray(data.titles)){
166
- data.titles.forEach((index, title) => {
167
- if(index == 1){
168
  t += title + "<br>"
169
- } else if (index == 2) {
170
  t += "<pre>" + title + "<br></pre>"
171
  } else {
172
  t += title + "<br>"
173
  }
174
- });
175
  popupText.innerHTML = t;
176
  } else {
177
  popupText.textContent = data.titles;
 
163
  }
164
  let t = "";
165
  if(Array.isArray(data.titles)){
166
+ for(const [lvl, title] of data.titles){
167
+ if(lvl == 1){
168
  t += title + "<br>"
169
+ } else if (lvl == 2) {
170
  t += "<pre>" + title + "<br></pre>"
171
  } else {
172
  t += title + "<br>"
173
  }
174
+ }
175
  popupText.innerHTML = t;
176
  } else {
177
  popupText.textContent = data.titles;