mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
WebUI: Use native function for selecting elements by ID
This commit is contained in:
@@ -66,7 +66,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
||||
};
|
||||
|
||||
// option diffs menu
|
||||
this.menu = $(this.options.menu);
|
||||
this.menu = document.getElementById(this.options.menu);
|
||||
|
||||
// fx
|
||||
this.fx = new Fx.Tween(this.menu, {
|
||||
@@ -457,7 +457,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
||||
this.setEnabled("copyInfohash1", thereAreV1Hashes);
|
||||
this.setEnabled("copyInfohash2", thereAreV2Hashes);
|
||||
|
||||
const contextTagList = $("contextTagList");
|
||||
const contextTagList = document.getElementById("contextTagList");
|
||||
for (const tag of tagMap.keys()) {
|
||||
const checkbox = contextTagList.querySelector(`a[href="#Tag/${tag}"] input[type="checkbox"]`);
|
||||
const count = tagCount.get(tag);
|
||||
@@ -477,7 +477,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
||||
}
|
||||
|
||||
updateCategoriesSubMenu(categories) {
|
||||
const contextCategoryList = $("contextCategoryList");
|
||||
const contextCategoryList = document.getElementById("contextCategoryList");
|
||||
[...contextCategoryList.children].forEach((el) => { el.destroy(); });
|
||||
|
||||
const createMenuItem = (text, imgURL, clickFn) => {
|
||||
@@ -527,7 +527,7 @@ window.qBittorrent.ContextMenu ??= (() => {
|
||||
}
|
||||
|
||||
updateTagsSubMenu(tags) {
|
||||
const contextTagList = $("contextTagList");
|
||||
const contextTagList = document.getElementById("contextTagList");
|
||||
contextTagList.replaceChildren();
|
||||
|
||||
const createMenuItem = (text, imgURL, clickFn) => {
|
||||
@@ -727,8 +727,8 @@ window.qBittorrent.ContextMenu ??= (() => {
|
||||
this.menu.style.left = "-999em";
|
||||
this.menu.style.top = "-999em";
|
||||
// position the menu
|
||||
let xPosMenu = e.pageX + this.options.offsets.x - $("rssdownloaderpage").offsetLeft;
|
||||
let yPosMenu = e.pageY + this.options.offsets.y - $("rssdownloaderpage").offsetTop;
|
||||
let xPosMenu = e.pageX + this.options.offsets.x - document.getElementById("rssdownloaderpage").offsetLeft;
|
||||
let yPosMenu = e.pageY + this.options.offsets.y - document.getElementById("rssdownloaderpage").offsetTop;
|
||||
if ((xPosMenu + this.menu.offsetWidth) > document.documentElement.clientWidth)
|
||||
xPosMenu -= this.menu.offsetWidth;
|
||||
if ((yPosMenu + this.menu.offsetHeight) > document.documentElement.clientHeight)
|
||||
|
||||
Reference in New Issue
Block a user