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
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
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 {
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";

View File

@ -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);

View File

@ -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"); });

View File

@ -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({