WebUI: prefer using arrow functions

For addressing WebUI CI failures on v5_1_x branch.
This commit is contained in:
Chocobo1
2025-11-03 13:25:35 +08:00
parent 2979b1e0e4
commit 7bbe8eff51
4 changed files with 8 additions and 8 deletions

View File

@@ -349,7 +349,7 @@ window.qBittorrent.DynamicTable ??= (() => {
} }
}, },
setupDynamicTableHeaderContextMenuClass: function() { setupDynamicTableHeaderContextMenuClass: () => {
DynamicTableHeaderContextMenuClass ??= class extends window.qBittorrent.ContextMenu.ContextMenu { DynamicTableHeaderContextMenuClass ??= class extends window.qBittorrent.ContextMenu.ContextMenu {
updateMenuItems() { updateMenuItems() {
for (let i = 0; i < this.dynamicTable.columns.length; ++i) { for (let i = 0; i < this.dynamicTable.columns.length; ++i) {
@@ -2316,7 +2316,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.updateGlobalCheckbox(); this.updateGlobalCheckbox();
}, },
_sortNodesByColumn: function(nodes, column) { _sortNodesByColumn: (nodes, column) => {
nodes.sort((row1, row2) => { nodes.sort((row1, row2) => {
// list folders before files when sorting by name // list folders before files when sorting by name
if (column.name === "original") { if (column.name === "original") {
@@ -2633,7 +2633,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.columns["availability"].updateTd = displayPercentage; this.columns["availability"].updateTd = displayPercentage;
}, },
_sortNodesByColumn: function(nodes, column) { _sortNodesByColumn: (nodes, column) => {
nodes.sort((row1, row2) => { nodes.sort((row1, row2) => {
// list folders before files when sorting by name // list folders before files when sorting by name
if (column.name === "name") { if (column.name === "name") {
@@ -3012,7 +3012,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.newColumn("checked", "", "", 30, true); this.newColumn("checked", "", "", 30, true);
this.newColumn("name", "", "", -1, true); this.newColumn("name", "", "", -1, true);
this.columns["checked"].updateTd = function(td, row) { this.columns["checked"].updateTd = (td, row) => {
if ($(`cbRssDlRule${row.rowId}`) === null) { if ($(`cbRssDlRule${row.rowId}`) === null) {
const checkbox = document.createElement("input"); const checkbox = document.createElement("input");
checkbox.type = "checkbox"; checkbox.type = "checkbox";
@@ -3110,7 +3110,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.newColumn("checked", "", "", 30, true); this.newColumn("checked", "", "", 30, true);
this.newColumn("name", "", "", -1, true); this.newColumn("name", "", "", -1, true);
this.columns["checked"].updateTd = function(td, row) { this.columns["checked"].updateTd = (td, row) => {
if ($(`cbRssDlFeed${row.rowId}`) === null) { if ($(`cbRssDlFeed${row.rowId}`) === null) {
const checkbox = document.createElement("input"); const checkbox = document.createElement("input");
checkbox.type = "checkbox"; checkbox.type = "checkbox";

View File

@@ -103,7 +103,7 @@ window.qBittorrent.FileTree ??= (() => {
return nodes; return nodes;
}, },
_getArrayOfNodes: function(node, array) { _getArrayOfNodes: (node, array) => {
array.push(node); array.push(node);
node.children.each((child) => { node.children.each((child) => {
this._getArrayOfNodes(child, array); this._getArrayOfNodes(child, array);

View File

@@ -73,7 +73,7 @@ window.qBittorrent.pathAutofill ??= (() => {
.catch(error => {}); .catch(error => {});
}; };
function attachPathAutofill() { const attachPathAutofill = () => {
const directoryInputs = document.querySelectorAll(".pathDirectory:not(.pathAutoFillInitialized)"); const directoryInputs = document.querySelectorAll(".pathDirectory:not(.pathAutoFillInitialized)");
for (const input of directoryInputs) { for (const input of directoryInputs) {
input.addEventListener("input", function() { showPathSuggestions(this, "dirs"); }); input.addEventListener("input", function() { showPathSuggestions(this, "dirs"); });

View File

@@ -773,7 +773,7 @@ window.qBittorrent.Search ??= (() => {
$("numSearchResultsVisible").textContent = searchResultsTable.getFilteredAndSortedRows().length; $("numSearchResultsVisible").textContent = searchResultsTable.getFilteredAndSortedRows().length;
}; };
const loadSearchResultsData = function(searchId) { const loadSearchResultsData = (searchId) => {
const state = searchState.get(searchId); const state = searchState.get(searchId);
const url = new URL("api/v2/search/results", window.location); const url = new URL("api/v2/search/results", window.location);
url.search = new URLSearchParams({ url.search = new URLSearchParams({