Fix bug where graphs would make multiple ajax queries.
This commit is contained in:
@@ -373,38 +373,31 @@
|
|||||||
loadGraphsTab1(current_range, yaxis);
|
loadGraphsTab1(current_range, yaxis);
|
||||||
|
|
||||||
// Tab1 opened
|
// Tab1 opened
|
||||||
$('#graph-tabs a[href="#tabs-1"]').click(function (e) {
|
$('#graph-tabs a[href="#tabs-1"]').on('shown.bs.tab', function (e) {
|
||||||
current_tab = $(this).attr('href');
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).tab('show');
|
current_tab = $(this).attr('href');
|
||||||
$(this).on('shown.bs.tab', function (e) {
|
$('#days-selection').show();
|
||||||
$('#days-selection').show();
|
loadGraphsTab1(current_range, yaxis);
|
||||||
loadGraphsTab1(current_range, yaxis);
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Tab2 opened
|
// Tab2 opened
|
||||||
$('#graph-tabs a[href="#tabs-2"]').click(function (e) {
|
$('#graph-tabs a[href="#tabs-2"]').on('shown.bs.tab', function (e) {
|
||||||
current_tab = $(this).attr('href');
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).tab('show');
|
current_tab = $(this).attr('href');
|
||||||
$(this).on('shown.bs.tab', function (e) {
|
$('#days-selection').show();
|
||||||
$('#days-selection').show();
|
loadGraphsTab2(current_range, yaxis);
|
||||||
loadGraphsTab2(current_range, yaxis);
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Tab3 opened
|
// Tab3 opened
|
||||||
$('#graph-tabs a[href="#tabs-3"]').click(function (e) {
|
$('#graph-tabs a[href="#tabs-3"').on('shown.bs.tab', function (e) {
|
||||||
current_tab = $(this).attr('href');
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).tab('show');
|
current_tab = $(this).attr('href');
|
||||||
$(this).on('shown.bs.tab', function (e) {
|
$('#days-selection').hide();
|
||||||
$('#days-selection').hide();
|
console.log('loading....');
|
||||||
loadGraphsTab3(yaxis);
|
loadGraphsTab3(yaxis);
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// Date range changed
|
// Date range changed
|
||||||
$('#days-selection').on('change', function() {
|
$('#days-selection').on('change', function() {
|
||||||
current_range = $('input[name=date-options]:checked', '#days-selection').val();
|
current_range = $('input[name=date-options]:checked', '#days-selection').val();
|
||||||
|
Reference in New Issue
Block a user