mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-20 14:33:42 +03:00
WebUI: remove child elements directly
This commit is contained in:
parent
e1bd1038c0
commit
72e033db79
2 changed files with 4 additions and 9 deletions
|
@ -535,8 +535,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
|||
|
||||
updateTagsSubMenu(tagList) {
|
||||
const contextTagList = $("contextTagList");
|
||||
while (contextTagList.firstChild !== null)
|
||||
contextTagList.removeChild(contextTagList.firstChild);
|
||||
contextTagList.replaceChildren();
|
||||
|
||||
const createMenuItem = (text, imgURL, clickFn) => {
|
||||
const anchor = document.createElement("a");
|
||||
|
|
|
@ -288,8 +288,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
LocalPreferences.set("columns_order_" + this.dynamicTableDivId, val.join(","));
|
||||
this.loadColumnsOrder();
|
||||
this.updateTableHeaders();
|
||||
while (this.tableBody.firstChild)
|
||||
this.tableBody.removeChild(this.tableBody.firstChild);
|
||||
this.tableBody.replaceChildren();
|
||||
this.updateTable(true);
|
||||
}
|
||||
if (this.currentHeaderAction === "drag") {
|
||||
|
@ -465,11 +464,8 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
this.showColumn(action, this.columns[action].visible === "0");
|
||||
}.bind(this);
|
||||
|
||||
// recreate child nodes when reusing (enables the context menu to work correctly)
|
||||
if (ul.hasChildNodes()) {
|
||||
while (ul.firstChild)
|
||||
ul.removeChild(ul.lastChild);
|
||||
}
|
||||
// recreate child elements when reusing (enables the context menu to work correctly)
|
||||
ul.replaceChildren();
|
||||
|
||||
for (let i = 0; i < this.columns.length; ++i) {
|
||||
const text = this.columns[i].caption;
|
||||
|
|
Loading…
Add table
Reference in a new issue