added flag to track chart loading progress and preevent double loading
This commit is contained in:
parent
0d791a6b43
commit
bfc5c40449
1 changed files with 7 additions and 0 deletions
|
@ -132,6 +132,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var chart;
|
var chart;
|
||||||
var chartData = [];
|
var chartData = [];
|
||||||
|
var chartLoadInProgress = false;
|
||||||
var minPeriod = 'hh';
|
var minPeriod = 'hh';
|
||||||
var defaultPeriod = '24h';
|
var defaultPeriod = '24h';
|
||||||
var periodGridCounts = {'24h': 24, '72h': 24, '168h': 14, '30d': 30, '90d': 45, '1y': 12 };
|
var periodGridCounts = {'24h': 24, '72h': 24, '168h': 14, '30d': 30, '90d': 45, '1y': 12 };
|
||||||
|
@ -290,6 +291,7 @@
|
||||||
type: 'get',
|
type: 'get',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
|
chartLoadInProgress = true;
|
||||||
loadProgress.css({ display: 'block' });
|
loadProgress.css({ display: 'block' });
|
||||||
},
|
},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
@ -322,6 +324,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete: function() {
|
complete: function() {
|
||||||
|
chartLoadInProgress = false;
|
||||||
loadProgress.css({ display: 'none' });
|
loadProgress.css({ display: 'none' });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -330,6 +333,10 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.block-size-data-links a').on('click', function(evt) {
|
$('.block-size-data-links a').on('click', function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
if (chartLoadInProgress) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var link = $(this);
|
var link = $(this);
|
||||||
if (link.hasClass('active')) {
|
if (link.hasClass('active')) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue