Added visual indicator for while waiting for API refresh response.
This commit is contained in:
parent
6dfec65935
commit
451083cf0b
@ -67,10 +67,15 @@ $("#get-help").click (e) ->
|
||||
|
||||
$("#api-refresh").click (e) ->
|
||||
e.preventDefault();
|
||||
$("#api-refresh").find('span').addClass('glyphicon-spin');
|
||||
$.post("/refresh").success(() ->
|
||||
refreshQuestion()
|
||||
$('#success-area').show()
|
||||
).fail(() -> $('#error-area').show());
|
||||
refreshQuestion();
|
||||
$("#api-refresh").find('span').removeClass('glyphicon-spin');
|
||||
$('#success-area').show();
|
||||
).fail(() ->
|
||||
$('#error-area').show();
|
||||
$("#api-refresh").find('span').removeClass('glyphicon-spin');
|
||||
);
|
||||
|
||||
$('#error-area').find('button').click () ->
|
||||
$('#error-area').hide()
|
||||
|
@ -90,11 +90,14 @@
|
||||
|
||||
$("#api-refresh").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#api-refresh").find('span').addClass('glyphicon-spin');
|
||||
return $.post("/refresh").success(function() {
|
||||
refreshQuestion();
|
||||
$("#api-refresh").find('span').removeClass('glyphicon-spin');
|
||||
return $('#success-area').show();
|
||||
}).fail(function() {
|
||||
return $('#error-area').show();
|
||||
$('#error-area').show();
|
||||
return $("#api-refresh").find('span').removeClass('glyphicon-spin');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -45,4 +45,29 @@ body{
|
||||
|
||||
.navbar-text > a > img{
|
||||
max-height: 26px;
|
||||
}
|
||||
|
||||
.glyphicon-spin {
|
||||
-webkit-animation: spin 1000ms infinite linear;
|
||||
animation: spin 1000ms infinite linear;
|
||||
}
|
||||
@-webkit-keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user