Updated delay input

This commit is contained in:
Igor Nurullaev
2019-09-02 19:53:28 +03:00
parent afc26be64d
commit c15d540505
2 changed files with 10 additions and 12 deletions

View File

@@ -9,7 +9,8 @@ function updateDelay() {
req.open('POST', '/get/delay', false);
req.send();
delay = parseInt(req.response);
document.getElementById('delay').innerText = 'Set time (now is ' + delay.toString() + ')';
document.getElementById('delay').placeholder = 'Set delay (now is ' + delay.toString() + ')';
document.getElementById('delay').value = null;
}
function setDelay(delay) {
@@ -102,15 +103,12 @@ function stopCopters() {
}
function setStartTime() {
Ply.dialog("prompt", {
title: "Set animation delay",
form: {delay: "Delay"}
}).done(function (ui) {
if (ui.state) {
setDelay(parseInt(ui.data.delay));
updateDelay();
}
});
spinner.style.display = 'inline-block';
setTimeout(function () {
setDelay(parseInt(document.getElementById('delay').value));
updateDelay();
spinner.style.display = 'none';
}, 20);
}
function takeOff() {