Commit bd4182c9 by Sheng

Disable button for a short time after submission

parent c5c4f570
jQuery(function($){
var status = $('#status'),
btn = $('.btn-primary');
$('form#connect').submit(function(event) {
event.preventDefault();
status.text('');
btn.prop('disabled', true);
var form = $(this),
url = form.attr('action'),
......@@ -22,7 +28,10 @@ jQuery(function($){
function callback(msg) {
// console.log(msg);
if (msg.status) {
$('#status').text(msg.status);
status.text(msg.status);
setTimeout(function(){
btn.prop('disabled', false);
}, 3000);
return;
}
......
......@@ -58,7 +58,7 @@
</div>
<div class="container">
<div id="status"></div>
<div id="status" style="color: red;"></div>
<div id="terminal"></div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment