From fa7cdc020b1713e0a7e8e9a005253eaadbc0162e Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 26 Mar 2019 15:32:57 +0100 Subject: [PATCH] Add a countdown to license error messages. Former-commit-id: bba7ccf777c05801731a790351dc9920b1546262 --- .../include/javascript/jquery.pandora.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index bd0da308c4..9e0b3447af 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -163,12 +163,21 @@ $(document).ready (function () { background: "black" }, open: function() { - setTimeout(function(){ - $("#spinner_ok").hide(); + var remaining = 30; + + // Timeout counter. + var count = function() { + if (remaining > 0) { + $("#license_error_remaining").text(remaining); + remaining -= 1; + } else { + $("#license_error_remaining").hide(); $("#ok_buttom").show(); - }, - 30000 - ); + clearInterval(count); + } + } + + setInterval(count, 1000); } });