From 2bb45a9463a82fa41f57b1f9c22ef0baabdb9e1c Mon Sep 17 00:00:00 2001 From: Mark Yu Date: Mon, 14 Jul 2025 14:19:30 -0400 Subject: [PATCH] global element variable --- src/webui/www/private/shareratio.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/webui/www/private/shareratio.html b/src/webui/www/private/shareratio.html index 26cb5af57..057f58797 100644 --- a/src/webui/www/private/shareratio.html +++ b/src/webui/www/private/shareratio.html @@ -12,8 +12,11 @@ const UseGlobalLimit = -2; const NoLimit = -1; + let limitReachedActionsEl; window.addEventListener("DOMContentLoaded", (event) => { + limitReachedActionsEl = document.getElementById("limitReachedActions"); + window.addEventListener("keydown", (event) => { switch (event.key) { case "Enter": @@ -67,7 +70,7 @@ document.getElementById("inactiveMinutes").value = values.inactiveSeedingTimeLimit; } - document.getElementById("limitReachedActions").value = values.shareLimitAction.toString(); + limitReachedActionsEl.value = values.shareLimitAction.toString(); } shareLimitChanged(); @@ -96,7 +99,7 @@ ratioLimitValue = document.getElementById("setRatio").checked ? document.getElementById("ratio").value : -1; seedingTimeLimitValue = document.getElementById("setTotalMinutes").checked ? document.getElementById("totalMinutes").value : -1; inactiveSeedingTimeLimitValue = document.getElementById("setInactiveMinutes").checked ? document.getElementById("inactiveMinutes").value : -1; - shareLimitActionValue = document.getElementById("limitReachedActions").value; + shareLimitActionValue = limitReachedActionsEl.value; } else { return; @@ -146,7 +149,7 @@ document.getElementById("setRatio").disabled = !customShareLimit; document.getElementById("setTotalMinutes").disabled = !customShareLimit; document.getElementById("setInactiveMinutes").disabled = !customShareLimit; - document.getElementById("limitReachedActions").disabled = !customShareLimit; + limitReachedActionsEl.disabled = !customShareLimit; enableInputBoxes();