WebUI: Use vanilla JS to create elements

All elements are now created using createElement() method:
https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement

PR #21975.

---------

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
This commit is contained in:
skomerko
2024-12-14 20:31:44 +01:00
committed by GitHub
parent 4c6dd8e68d
commit 14684c8c83
7 changed files with 167 additions and 190 deletions

View File

@@ -131,7 +131,7 @@ window.qBittorrent.PropFiles ??= (() => {
};
const createDownloadCheckbox = (id, fileId, checked) => {
const checkbox = new Element("input");
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.id = "cbPrio" + id;
checkbox.setAttribute("data-id", id);
@@ -623,13 +623,13 @@ window.qBittorrent.PropFiles ??= (() => {
// inject checkbox into table header
const tableHeaders = $$("#torrentFilesTableFixedHeaderDiv .dynamicTableHeader th");
if (tableHeaders.length > 0) {
const checkbox = new Element("input");
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.id = "tristate_cb";
checkbox.addEventListener("click", switchCheckboxState);
const checkboxTH = tableHeaders[0];
checkbox.injectInside(checkboxTH);
checkboxTH.append(checkbox);
}
// default sort by name column