$( document ).ready(function() {
// Initiate tooltips.
$('[data-toggle="tooltip"]').tooltip();
//bind click on outcomes modal
//$('#showOutcomesPanelist').on('click', '', function(){
$(document).on('click', '#showOutcomesPanelist', function(e){
var ctxmodal = document.getElementById('dataPresentationModalChart');
window.myBarChart = new Chart(ctxmodal, config);
});
//show citations modal
$(document).on('click', '#showCitations', function(e){
var ctxmodal2 = document.getElementById('dataPresentationModalChart2');
window.myBarChart2 = new Chart(ctxmodal2, config2);
});
// Initiate the date range picker with empty as a possibility.
$('input[name="daterange"]').daterangepicker(
{
autoUpdateInput: false,
locale: {
format: 'YYYY-MM-DD',
cancelLabel: 'Clear'
},
startDate: '2025-01-24',
endDate: '2025-01-30',
drops: 'down'
});
$('input[name="daterange"]').on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' to ' + picker.endDate.format('YYYY-MM-DD'));
});
$('input[name="daterange"]').on('cancel.daterangepicker', function(ev, picker) {
$(this).val('');
});
//preset date selector
$(document).on('change', '#preset-date', function(e){
$('#daterange').val($('#preset-date').val());
});
//panelist research reset
$(document).on('click', '#panelistResearchReset', function(e){
e.preventDefault();
var searchPanelists = $('#search-results').DataTable();
searchPanelists.state.clear();
window.location = window.location.href;
});
//show all on big tables
$(document).on('click', '#showPanelistsServed', function(e){
$("#panelistsServed tr").show();
$(this).hide();
});
$(document).on('click', '#showCasePanelistCiting', function(e){
$("#casePanelistCiting tr").show();
$(this).hide();
});
$(document).on('click', '#prCitationsUsedSolo', function(e){
$("#table_prCitationsUsedSolo tr").show();
$(this).hide();
});
$(document).on('click', '#prCitationsUsedGroup', function(e){
$("#table_prCitationsUsedGroup tr").show();
$(this).hide();
});
$(document).on('click', '#prCitedSolo', function(e){
$("#table_prCitedSolo tr").show();
$(this).hide();
});
$(document).on('click', '#prCitedGroup', function(e){
$("#table_prCitedGroup tr").show();
$(this).hide();
});
//on click of #fontChange switch font size between 14px and 16px
$(document).on('click', '#fontChange', function(e){
if($('body').attr('style') == 'font-size: 16px;'){
$('body').attr('style', 'font-size: 14px;');
}else{
$('body').attr('style', 'font-size: 16px;');
}
});
});