Skip to content

Commit d6a6389

Browse files
committed
replace for each with regular for
1 parent a3de9e3 commit d6a6389

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

R/mod_listings.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,14 @@ listings_UI <- function(module_id) { # nolint
107107
const table_container_id = '%s';
108108
const table = document.querySelector('#' + table_container_id + ' table.dataTable');
109109
if (!table) return;
110-
console.log('table found');
111-
112110
113111
const headers = table.querySelectorAll('thead tr')[0]?.querySelectorAll('th.dtfc-fixed-left');
114112
const filters = table.querySelectorAll('thead tr')[1]?.querySelectorAll('td');
113+
115114
if (!headers || !filters) return;
116-
console.log('headers found');
117-
headers.forEach((th, i) => {
118-
const td = filters[i];
115+
for(let idx = 0; idx < headers.length; ++idx){
116+
const th = headers[idx];
117+
const td = filters[idx];
119118
if (!td) return;
120119
121120
const computed_style = window.getComputedStyle(th);
@@ -126,8 +125,8 @@ listings_UI <- function(module_id) { # nolint
126125
td.style.position = 'sticky';
127126
td.style.left = left;
128127
td.style.zIndex = zIndex;
129-
});
130-
});", ns(TBL$TABLE_ID), ns(TBL$TABLE_ID), ns(TBL$TABLE_ID))))
128+
}
129+
});", ns(TBL$TABLE_ID), ns(TBL$TABLE_ID))))
131130

132131
)
133132
}

0 commit comments

Comments
 (0)