diff options
author | Mango0x45 <thomasvoss@live.com> | 2021-02-05 23:56:46 +0100 |
---|---|---|
committer | Mango0x45 <thomasvoss@live.com> | 2021-02-05 23:56:46 +0100 |
commit | 928b21beb768bca2bab93a0d0f896f027b45de25 (patch) | |
tree | 8f3055f98270aec1f0143acddf3910f961e1b052 | |
parent | 3711e62b20c65dca811f7336453dc178a0e5328f (diff) |
Less ugly if statement
-rw-r--r-- | main.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -60,18 +60,18 @@ function copy_mod_message() * frame fields */ function check_fps(event) { - if (event.target.value === "" || parseInt(event.target.value) <= 0 - || isNaN(parseInt(event.target.value))) { + fps = event.target.value; + if (fps > 0 && fps % 1 == fps) { + document.getElementById("startobj").disabled = false; + document.getElementById("endobj").disabled = false; + document.getElementById("compute_button").disabled = false; + } else { document.getElementById("framerate") .setCustomValidity("Please enter a valid framerate."); document.getElementById("framerate").reportValidity(); document.getElementById("startobj").disabled = true; document.getElementById("endobj").disabled = true; document.getElementById("compute_button").disabled = true; - } else { - document.getElementById("startobj").disabled = false; - document.getElementById("endobj").disabled = false; - document.getElementById("compute_button").disabled = false; } } |