/* responsive options */ var responsiveOptions = [ ['screen and (max-width: 1920px)', { axisX: { labelInterpolationFnc: function skipLabels(value, index) { return index % 2 === 0 ? value : null; } } }], ['screen and (max-width: 1536px)', { axisX: { labelInterpolationFnc: function skipLabels(value, index) { return index % 2 === 0 ? value : null; } } }], ['screen and (max-width: 1440px)', { axisX: { labelInterpolationFnc: function skipLabels(value, index) { return index % 3 === 0 ? value : null; } } }], ['screen and (max-width: 800px)', { axisX: { labelInterpolationFnc: function skipLabels(value, index) { return index % 5 === 0 ? value : null; } } }], ['screen and (max-width: 400px)', { axisX: { labelInterpolationFnc: function skipLabels(value, index) { return index % 6 === 0 ? value : null; } } }], ['screen and (max-width: 300px)', { axisX: { labelInterpolationFnc: function skipLabels(value, index) { return index % 7 === 0 ? value : null; } } }] ]; /* end responsive options */ function ls() { cs('stat_cases'); cs('stat_tested'); cs('stat_change'); cs('stat_deaths'); cs('stat_deaths_reported'); } function cs(obj) { var stat = $('#'+obj).data('stat'); if (stat) { $('#'+obj).load('/stat.php?id='+stat); } } function getSurveys() { $('#surveys_panel').load('/panel_surveys.php', function() { $(".polllink").click(function() { id = $(this).data("poll"); if (id > 0) { getSpecificSurvey(id); } }); $(".polloptionlink").click(function() { id = $(this).data("poll"); option = $(this).data("option"); if (id > 0) { voteSpecificSurvey(id, option); } }); }); } function getSpecificSurvey(id) { $('#surveys_panel').load('/panel_surveys.php?id='+id, function() { gtag('event', 'change survey'); $(".polllink").click(function() { id = $(this).data("poll"); if (id > 0) { getSpecificSurvey(id); } }); $(".polloptionlink").click(function() { id = $(this).data("poll"); option = $(this).data("option"); if (id > 0) { voteSpecificSurvey(id, option); } }); }); } function voteSpecificSurvey(id, option) { $('#surveys_panel').load('/panel_surveys.php?id='+id+'&vote='+option, function() { $(".polllink").click(function() { id = $(this).data("poll"); if (id > 0) { getSpecificSurvey(id); gtag('event', 'survey vote'); } }); }); } $(function() { /*setInterval(function() { ls(); }, 60000);*/ $("#countyField").on("keyup", function() { console.log('test'); var value = $(this).val().toLowerCase(); $("#countieslist tbody > tr").filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); //getSurveys(); });