javascripts/pagy-module.js in pagy-8.4.3 vs javascripts/pagy-module.js in pagy-8.4.4

- old
+ new

@@ -11,23 +11,22 @@ return; } let html = tokens.before; const series = sequels[width.toString()]; const labels = labelSequels?.[width.toString()] ?? series.map((l) => l.toString()); - for (const i in series) { - const item = series[i]; + series.forEach((item, i) => { const label = labels[i]; let filled; if (typeof item === "number") { filled = fillIn(tokens.a, item.toString(), label); } else if (item === "gap") { filled = tokens.gap; } else { filled = fillIn(tokens.current, item, label); } html += typeof trimParam === "string" && item == 1 ? trim(filled, trimParam) : filled; - } + }); html += tokens.after; el.innerHTML = ""; el.insertAdjacentHTML("afterbegin", html); lastWidth = width; })(); @@ -62,20 +61,20 @@ url = trim(url, trimParam); } link.href = url; link.click(); }; - ["change", "focus"].forEach((e) => input.addEventListener(e, input.select)); + ["change", "focus"].forEach((e) => input.addEventListener(e, () => input.select())); input.addEventListener("focusout", action); input.addEventListener("keypress", (e) => { if (e.key === "Enter") { action(); } }); }; const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), ""); return { - version: "8.4.3", + version: "8.4.4", init(arg) { const target = arg instanceof Element ? arg : document; const elements = target.querySelectorAll("[data-pagy]"); for (const el of elements) { try {