mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
WebUI: prefer arrow functions whenever applicable
Compared to plain function, arrow function is simpler to understand (without bindings to `this`, `arguments`, `super`) and to read. Now, plain function will only be used when this object is required. PR #21691.
This commit is contained in:
@@ -46,7 +46,7 @@ window.qBittorrent.PiecesBar ??= (() => {
|
||||
|
||||
let piecesBarUniqueId = 0;
|
||||
const PiecesBar = new Class({
|
||||
initialize(pieces, parameters) {
|
||||
initialize: (pieces, parameters) => {
|
||||
const vals = {
|
||||
"id": "piecesbar_" + (piecesBarUniqueId++),
|
||||
"width": 0,
|
||||
@@ -253,7 +253,7 @@ window.qBittorrent.PiecesBar ??= (() => {
|
||||
}
|
||||
}
|
||||
|
||||
function checkForParent(id) {
|
||||
const checkForParent = (id) => {
|
||||
const obj = $(id);
|
||||
if (!obj)
|
||||
return;
|
||||
@@ -261,7 +261,7 @@ window.qBittorrent.PiecesBar ??= (() => {
|
||||
return setTimeout(() => { checkForParent(id); }, 100);
|
||||
|
||||
obj.refresh();
|
||||
}
|
||||
};
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user