WebUI: Eliminate redundant DOM element queries

This commit is contained in:
skomerko
2025-04-12 11:53:52 +02:00
parent 0b3bce8993
commit 7b3aa51bb1
3 changed files with 4 additions and 4 deletions

View File

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