Fixed working indicator CPU usage
This commit is contained in:
parent
e8cb038ea6
commit
18dceb2924
@ -10,12 +10,13 @@ define([
|
|||||||
var $workingIndicatorElt;
|
var $workingIndicatorElt;
|
||||||
workingIndicator.onAsyncRunning = function (isRunning) {
|
workingIndicator.onAsyncRunning = function (isRunning) {
|
||||||
$bodyElt.toggleClass("working", isRunning);
|
$bodyElt.toggleClass("working", isRunning);
|
||||||
$workingIndicatorElt.toggleClass("show", isRunning);
|
$workingIndicatorElt.toggleClass("hide", !isRunning);
|
||||||
};
|
};
|
||||||
|
|
||||||
workingIndicator.onReady = function () {
|
workingIndicator.onReady = function () {
|
||||||
$bodyElt = $(document.body);
|
$bodyElt = $(document.body);
|
||||||
$workingIndicatorElt = $(".working-indicator");
|
$workingIndicatorElt = $('<div class="hide">');
|
||||||
|
$('.working-indicator').append($workingIndicatorElt);
|
||||||
for (var i = 0; i < 4; i++) {
|
for (var i = 0; i < 4; i++) {
|
||||||
$workingIndicatorElt.append($('<div class="bar">').css({
|
$workingIndicatorElt.append($('<div class="bar">').css({
|
||||||
'animation-delay': (i*2/10).toPrecision(3) + 's',
|
'animation-delay': (i*2/10).toPrecision(3) + 's',
|
||||||
@ -25,5 +26,4 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
return workingIndicator;
|
return workingIndicator;
|
||||||
|
|
||||||
});
|
});
|
@ -332,22 +332,19 @@ a {
|
|||||||
.working-indicator {
|
.working-indicator {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: @input-height-base;
|
height: @input-height-base;
|
||||||
|
width: 65px;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
vertical-align: middle;
|
|
||||||
.bar {
|
.bar {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
visibility: hidden;
|
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
|
opacity: 0.25;
|
||||||
background-color: @btn-success-color;
|
background-color: @btn-success-color;
|
||||||
animation: indicator 0.6s ease-out infinite;
|
animation: indicator 0.8s ease-out infinite;
|
||||||
-webkit-animation: indicator 0.6s ease-out infinite; /* Safari and Chrome */
|
-webkit-animation: indicator 0.8s ease-out infinite; /* Safari and Chrome */
|
||||||
}
|
|
||||||
&.show div {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user