SAAS-1039 - add processing overlay to listener stats screen
This commit is contained in:
parent
3e29ecad79
commit
c45f1ddd1c
|
@ -3738,6 +3738,12 @@ button.btn-icon-text > i.icon-white {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#flot_placeholder.processing {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: url("img/loading.gif") no-repeat 50% 50% rgba(0, 0, 0, .25);
|
||||||
|
}
|
||||||
|
|
||||||
.dashboard-btn {
|
.dashboard-btn {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ $(document).ready(function() {
|
||||||
width = width * .91;
|
width = width * .91;
|
||||||
$("#listenerstat_content").find("#flot_placeholder").width(width);
|
$("#listenerstat_content").find("#flot_placeholder").width(width);
|
||||||
$("#listenerstat_content").find("#legend").width(width);
|
$("#listenerstat_content").find("#legend").width(width);
|
||||||
|
|
||||||
getDataAndPlot();
|
getDataAndPlot();
|
||||||
|
|
||||||
listenerstat_content.find("#his_submit").click(function(){
|
listenerstat_content.find("#his_submit").click(function(){
|
||||||
|
@ -21,7 +21,17 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function getDataAndPlot(startTimestamp, endTimestamp){
|
/**
|
||||||
|
* Toggle a spinner overlay so the user knows the page is processing
|
||||||
|
*/
|
||||||
|
function toggleOverlay() {
|
||||||
|
$('#flot_placeholder').toggleClass('processing');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDataAndPlot(startTimestamp, endTimestamp) {
|
||||||
|
// Turn on the processing overlay
|
||||||
|
toggleOverlay();
|
||||||
|
|
||||||
// get data
|
// get data
|
||||||
$.get(baseUrl+'Listenerstat/get-data', {start: startTimestamp, end: endTimestamp}, function(data){
|
$.get(baseUrl+'Listenerstat/get-data', {start: startTimestamp, end: endTimestamp}, function(data){
|
||||||
out = new Object();
|
out = new Object();
|
||||||
|
@ -37,6 +47,8 @@ function getDataAndPlot(startTimestamp, endTimestamp){
|
||||||
out[mpName] = plotData;
|
out[mpName] = plotData;
|
||||||
});
|
});
|
||||||
plot(out);
|
plot(out);
|
||||||
|
// Turn off the processing overlay
|
||||||
|
toggleOverlay();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue