mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-10 00:46:48 -06:00
WebUI: prefer using arrow functions
For addressing WebUI CI failures on v5_1_x branch.
This commit is contained in:
parent
2979b1e0e4
commit
7bbe8eff51
@ -349,7 +349,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
}
|
||||
},
|
||||
|
||||
setupDynamicTableHeaderContextMenuClass: function() {
|
||||
setupDynamicTableHeaderContextMenuClass: () => {
|
||||
DynamicTableHeaderContextMenuClass ??= class extends window.qBittorrent.ContextMenu.ContextMenu {
|
||||
updateMenuItems() {
|
||||
for (let i = 0; i < this.dynamicTable.columns.length; ++i) {
|
||||
@ -2316,7 +2316,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
this.updateGlobalCheckbox();
|
||||
},
|
||||
|
||||
_sortNodesByColumn: function(nodes, column) {
|
||||
_sortNodesByColumn: (nodes, column) => {
|
||||
nodes.sort((row1, row2) => {
|
||||
// list folders before files when sorting by name
|
||||
if (column.name === "original") {
|
||||
@ -2633,7 +2633,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
this.columns["availability"].updateTd = displayPercentage;
|
||||
},
|
||||
|
||||
_sortNodesByColumn: function(nodes, column) {
|
||||
_sortNodesByColumn: (nodes, column) => {
|
||||
nodes.sort((row1, row2) => {
|
||||
// list folders before files when sorting by name
|
||||
if (column.name === "name") {
|
||||
@ -3012,7 +3012,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
this.newColumn("checked", "", "", 30, true);
|
||||
this.newColumn("name", "", "", -1, true);
|
||||
|
||||
this.columns["checked"].updateTd = function(td, row) {
|
||||
this.columns["checked"].updateTd = (td, row) => {
|
||||
if ($(`cbRssDlRule${row.rowId}`) === null) {
|
||||
const checkbox = document.createElement("input");
|
||||
checkbox.type = "checkbox";
|
||||
@ -3110,7 +3110,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
this.newColumn("checked", "", "", 30, true);
|
||||
this.newColumn("name", "", "", -1, true);
|
||||
|
||||
this.columns["checked"].updateTd = function(td, row) {
|
||||
this.columns["checked"].updateTd = (td, row) => {
|
||||
if ($(`cbRssDlFeed${row.rowId}`) === null) {
|
||||
const checkbox = document.createElement("input");
|
||||
checkbox.type = "checkbox";
|
||||
|
||||
@ -103,7 +103,7 @@ window.qBittorrent.FileTree ??= (() => {
|
||||
return nodes;
|
||||
},
|
||||
|
||||
_getArrayOfNodes: function(node, array) {
|
||||
_getArrayOfNodes: (node, array) => {
|
||||
array.push(node);
|
||||
node.children.each((child) => {
|
||||
this._getArrayOfNodes(child, array);
|
||||
|
||||
@ -73,7 +73,7 @@ window.qBittorrent.pathAutofill ??= (() => {
|
||||
.catch(error => {});
|
||||
};
|
||||
|
||||
function attachPathAutofill() {
|
||||
const attachPathAutofill = () => {
|
||||
const directoryInputs = document.querySelectorAll(".pathDirectory:not(.pathAutoFillInitialized)");
|
||||
for (const input of directoryInputs) {
|
||||
input.addEventListener("input", function() { showPathSuggestions(this, "dirs"); });
|
||||
|
||||
@ -773,7 +773,7 @@ window.qBittorrent.Search ??= (() => {
|
||||
$("numSearchResultsVisible").textContent = searchResultsTable.getFilteredAndSortedRows().length;
|
||||
};
|
||||
|
||||
const loadSearchResultsData = function(searchId) {
|
||||
const loadSearchResultsData = (searchId) => {
|
||||
const state = searchState.get(searchId);
|
||||
const url = new URL("api/v2/search/results", window.location);
|
||||
url.search = new URLSearchParams({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user