mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
WebUI: prevent passing wrong parameter
The `event` object will be passed as the first parameter to the event handler. So wrap the event handler with a closure to prevent `event` leaking to other functions.
This commit is contained in:
@@ -753,14 +753,15 @@ window.qBittorrent.Search ??= (() => {
|
||||
};
|
||||
|
||||
const setupSearchTableEvents = function(enable) {
|
||||
const clickHandler = (e) => { downloadSearchTorrent(); };
|
||||
if (enable) {
|
||||
$$(".searchTableRow").each((target) => {
|
||||
target.addEventListener("dblclick", downloadSearchTorrent, false);
|
||||
target.addEventListener("dblclick", clickHandler);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$$(".searchTableRow").each((target) => {
|
||||
target.removeEventListener("dblclick", downloadSearchTorrent, false);
|
||||
target.removeEventListener("dblclick", clickHandler);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user