change variable scope to block

This commit is contained in:
Wolfgang 2024-05-26 20:21:38 +02:00
parent 2aa403d3c9
commit d43ffbaefb

View file

@ -39,7 +39,7 @@ div>label {
function create_element_link(element, href) { function create_element_link(element, href) {
element.addEventListener("click", () => { element.addEventListener("click", () => {
var lnk = document.createElement('a'); let lnk = document.createElement('a');
if (typeof href === "function") { if (typeof href === "function") {
lnk.href = href(); lnk.href = href();
@ -127,9 +127,9 @@ div>label {
} }
function update_table(bases, extensions) { function update_table(bases, extensions) {
var tdata = []; let tdata = [];
var base_header = {}; let base_header = {};
var ext_header = {}; let ext_header = {};
// first, fill base_header // first, fill base_header
bases.forEach((base) => { bases.forEach((base) => {
@ -208,7 +208,7 @@ div>label {
// require in tabular-tables // require in tabular-tables
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
var table = new Tabulator("#data-table", { let table = new Tabulator("#data-table", {
layout: "fitDataTable", layout: "fitDataTable",
initialSort: [ initialSort: [
{column: "frequency", dir: "asc"}, {column: "frequency", dir: "asc"},
@ -257,7 +257,7 @@ div>label {
}); });
table.on("tableBuilt", () => { table.on("tableBuilt", () => {
var div_togglebuttons = document.getElementById("togglebuttons"); let div_togglebuttons = document.getElementById("togglebuttons");
div_togglebuttons.innerHTML = "<span>Toggle column:</span>"; div_togglebuttons.innerHTML = "<span>Toggle column:</span>";
table.getColumns().forEach((col) => { table.getColumns().forEach((col) => {
let col_name = col.getField(); let col_name = col.getField();