WebUI: Remove elements directly

This commit is contained in:
Deleted user 2024-11-14 08:54:24 -03:00
commit b148d1944f
3 changed files with 4 additions and 4 deletions

View file

@ -534,7 +534,7 @@ window.qBittorrent.ContextMenu ??= (() => {
updateTagsSubMenu(tagList) { updateTagsSubMenu(tagList) {
const contextTagList = $("contextTagList"); const contextTagList = $("contextTagList");
while (contextTagList.firstChild !== null) while (contextTagList.firstChild !== null)
contextTagList.removeChild(contextTagList.firstChild); contextTagList.firstChild.remove();
const createMenuItem = (text, imgURL, clickFn) => { const createMenuItem = (text, imgURL, clickFn) => {
const anchor = document.createElement("a"); const anchor = document.createElement("a");

View file

@ -219,7 +219,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.loadColumnsOrder(); this.loadColumnsOrder();
this.updateTableHeaders(); this.updateTableHeaders();
while (this.tableBody.firstChild) while (this.tableBody.firstChild)
this.tableBody.removeChild(this.tableBody.firstChild); this.tableBody.firstChild.remove();
this.updateTable(true); this.updateTable(true);
} }
if (this.currentHeaderAction === "drag") { if (this.currentHeaderAction === "drag") {
@ -398,7 +398,7 @@ window.qBittorrent.DynamicTable ??= (() => {
// recreate child nodes when reusing (enables the context menu to work correctly) // recreate child nodes when reusing (enables the context menu to work correctly)
if (ul.hasChildNodes()) { if (ul.hasChildNodes()) {
while (ul.firstChild) while (ul.firstChild)
ul.removeChild(ul.lastChild); ul.lastChild.remove();
} }
for (let i = 0; i < this.columns.length; ++i) { for (let i = 0; i < this.columns.length; ++i) {

View file

@ -1124,7 +1124,7 @@ const initializeWindows = () => {
element.download = (name + ".torrent"); element.download = (name + ".torrent");
document.body.appendChild(element); document.body.appendChild(element);
element.click(); element.click();
document.body.removeChild(element); element.remove();
// https://stackoverflow.com/questions/53560991/automatic-file-downloads-limited-to-10-files-on-chrome-browser // https://stackoverflow.com/questions/53560991/automatic-file-downloads-limited-to-10-files-on-chrome-browser
await window.qBittorrent.Misc.sleep(200); await window.qBittorrent.Misc.sleep(200);