mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
WebUI: remove redundant events
The base class already handle them. Also optimize the base implementation a bit.
This commit is contained in:
parent
1179fc3de3
commit
0c580c3174
1 changed files with 2 additions and 15 deletions
|
@ -95,8 +95,9 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||||
const tableDiv = $(this.dynamicTableDivId);
|
const tableDiv = $(this.dynamicTableDivId);
|
||||||
const tableFixedHeaderDiv = $(this.dynamicTableFixedHeaderDivId);
|
const tableFixedHeaderDiv = $(this.dynamicTableFixedHeaderDivId);
|
||||||
|
|
||||||
|
const tableElement = tableFixedHeaderDiv.querySelector("table");
|
||||||
tableDiv.addEventListener("scroll", () => {
|
tableDiv.addEventListener("scroll", () => {
|
||||||
tableFixedHeaderDiv.getElements("table")[0].style.left = `${-tableDiv.scrollLeft}px`;
|
tableElement.style.left = `${-tableDiv.scrollLeft}px`;
|
||||||
});
|
});
|
||||||
|
|
||||||
// if the table exists within a panel
|
// if the table exists within a panel
|
||||||
|
@ -2764,13 +2765,6 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||||
|
|
||||||
this.hiddenTableHeader.appendChild(new Element("th"));
|
this.hiddenTableHeader.appendChild(new Element("th"));
|
||||||
this.fixedTableHeader.appendChild(new Element("th"));
|
this.fixedTableHeader.appendChild(new Element("th"));
|
||||||
},
|
|
||||||
setupCommonEvents: function() {
|
|
||||||
const scrollFn = function() {
|
|
||||||
$(this.dynamicTableFixedHeaderDivId).getElements("table")[0].style.left = -$(this.dynamicTableDivId).scrollLeft + "px";
|
|
||||||
}.bind(this);
|
|
||||||
|
|
||||||
$(this.dynamicTableDivId).addEventListener("scroll", scrollFn);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2859,13 +2853,6 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||||
|
|
||||||
this.hiddenTableHeader.appendChild(new Element("th"));
|
this.hiddenTableHeader.appendChild(new Element("th"));
|
||||||
this.fixedTableHeader.appendChild(new Element("th"));
|
this.fixedTableHeader.appendChild(new Element("th"));
|
||||||
},
|
|
||||||
setupCommonEvents: function() {
|
|
||||||
const scrollFn = function() {
|
|
||||||
$(this.dynamicTableFixedHeaderDivId).getElements("table")[0].style.left = -$(this.dynamicTableDivId).scrollLeft + "px";
|
|
||||||
}.bind(this);
|
|
||||||
|
|
||||||
$(this.dynamicTableDivId).addEventListener("scroll", scrollFn);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue