WebUI: Use native function for selecting elements by ID

This commit is contained in:
skomerko
2025-04-12 11:57:27 +02:00
parent 7b3aa51bb1
commit 411ca0f668
48 changed files with 1303 additions and 1303 deletions

View File

@@ -151,7 +151,7 @@ let exportTorrentFN = () => {};
const initializeWindows = () => {
saveWindowSize = (windowId) => {
const size = $(windowId).getSize();
const size = document.getElementById(windowId).getSize();
LocalPreferences.set(`window_${windowId}_width`, size.x);
LocalPreferences.set(`window_${windowId}_height`, size.y);
};
@@ -166,8 +166,8 @@ const initializeWindows = () => {
const addClickEvent = (el, fn) => {
["Link", "Button"].each((item) => {
if ($(el + item))
$(el + item).addEventListener("click", fn);
if (document.getElementById(el + item))
document.getElementById(el + item).addEventListener("click", fn);
});
};