mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-06 23:52:31 -06:00
WebUI: Use native function for selecting elements by ID
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
switch (event.key) {
|
||||
case "Enter":
|
||||
event.preventDefault();
|
||||
$("renameButton").click();
|
||||
document.getElementById("renameButton").click();
|
||||
break;
|
||||
case "Escape":
|
||||
event.preventDefault();
|
||||
@@ -31,15 +31,15 @@
|
||||
const name = searchParams.get("name");
|
||||
// set text field to current value
|
||||
if (name !== null)
|
||||
$("rename").value = name;
|
||||
document.getElementById("rename").value = name;
|
||||
|
||||
$("rename").focus();
|
||||
$("renameButton").addEventListener("click", (e) => {
|
||||
document.getElementById("rename").focus();
|
||||
document.getElementById("renameButton").addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
// check field
|
||||
const name = $("rename").value.trim();
|
||||
const name = document.getElementById("rename").value.trim();
|
||||
if ((name === null) || (name === ""))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user