mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06:00
WebUI: Eliminate redundant DOM element queries
This commit is contained in:
@@ -190,7 +190,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
||||
e.stopPropagation();
|
||||
}
|
||||
// record this as the trigger
|
||||
this.options.element = $(el);
|
||||
this.options.element = el;
|
||||
this.adjustMenuPosition(e);
|
||||
// show the menu
|
||||
this.show();
|
||||
@@ -219,7 +219,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
||||
});
|
||||
|
||||
// hide on body click
|
||||
$(document.body).addEventListener("click", () => {
|
||||
document.body.addEventListener("click", () => {
|
||||
this.hide();
|
||||
this.options.element = null;
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ window.qBittorrent.Download ??= (() => {
|
||||
}
|
||||
};
|
||||
|
||||
$(window).addEventListener("load", async () => {
|
||||
window.addEventListener("load", async () => {
|
||||
// user might load this page directly (via browser magnet handler)
|
||||
// so wait for crucial initialization to complete
|
||||
await window.parent.qBittorrent.Client.initializeCaches();
|
||||
|
||||
@@ -3168,7 +3168,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
||||
$("rowMarkOfTheWeb").style.display = "none";
|
||||
|
||||
$("networkInterface").addEventListener("change", function() {
|
||||
updateInterfaceAddresses($(this).value, "");
|
||||
updateInterfaceAddresses(this.value, "");
|
||||
});
|
||||
|
||||
loadPreferences();
|
||||
|
||||
Reference in New Issue
Block a user