WebUI: Eliminate redundant DOM element queries
This commit is contained in:
parent
0b3bce8993
commit
7b3aa51bb1
@ -190,7 +190,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
// record this as the trigger
|
// record this as the trigger
|
||||||
this.options.element = $(el);
|
this.options.element = el;
|
||||||
this.adjustMenuPosition(e);
|
this.adjustMenuPosition(e);
|
||||||
// show the menu
|
// show the menu
|
||||||
this.show();
|
this.show();
|
||||||
@ -219,7 +219,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// hide on body click
|
// hide on body click
|
||||||
$(document.body).addEventListener("click", () => {
|
document.body.addEventListener("click", () => {
|
||||||
this.hide();
|
this.hide();
|
||||||
this.options.element = null;
|
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)
|
// user might load this page directly (via browser magnet handler)
|
||||||
// so wait for crucial initialization to complete
|
// so wait for crucial initialization to complete
|
||||||
await window.parent.qBittorrent.Client.initializeCaches();
|
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";
|
$("rowMarkOfTheWeb").style.display = "none";
|
||||||
|
|
||||||
$("networkInterface").addEventListener("change", function() {
|
$("networkInterface").addEventListener("change", function() {
|
||||||
updateInterfaceAddresses($(this).value, "");
|
updateInterfaceAddresses(this.value, "");
|
||||||
});
|
});
|
||||||
|
|
||||||
loadPreferences();
|
loadPreferences();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user