WebUI: use native functions for event handling

PR #21147.
This commit is contained in:
Chocobo1
2024-08-07 22:00:54 +08:00
committed by GitHub
parent 989b1d176d
commit 2d9e3b3330
30 changed files with 261 additions and 196 deletions

View File

@@ -32,7 +32,7 @@
}
}).activate();
window.addEvent("domready", () => {
window.addEventListener("DOMContentLoaded", () => {
const hashesList = new URI().getData("hashes").split("|");
const origValues = new URI().getData("orig").split("|");
@@ -76,11 +76,12 @@
shareLimitChanged();
$("default").focus();
$("save").addEvent("click", (e) => {
new Event(e).stop();
$("save").addEventListener("click", (e) => {
e.preventDefault();
e.stopPropagation();
if (!isFormValid())
return false;
return;
const shareLimit = getSelectedRadioValue("shareLimit");
let ratioLimitValue = 0.00;
@@ -99,7 +100,7 @@
inactiveSeedingTimeLimitValue = $("setInactiveMinutes").checked ? $("inactiveMinutes").value : -1;
}
else {
return false;
return;
}
new Request({