// Fast Facts Special Chartbook View const ffToggles=thisChart=>{ let thisInfo=''; infoItems.forEach(info=>{ if ($.inArray(thisChart, info.pages)!==-1) { thisInfo=thisChart; thisChart='#'+ info.id } }); $('.ui-corner-top').removeClass('activeTab'); $('.chartSidebar, .chartArea').hide(); $('.current').removeClass('current'); $('.shaded').removeClass('shaded'); if (thisChart!='') { $(thisChart).show() } else { $('.chartArea:first').show() } sections.forEach(s=>{ if ($.inArray(thisChart, s.pages)!==-1) { $('#'+s.id).addClass('activeTab'); $('#'+s.id+'Sidebar').show(); } }); $('.chartSidebar a[href="'+thisChart+'"]').parent().addClass('current'); if (thisInfo!='') { $(thisInfo).addClass('shaded') } if ($.inArray(thisInfo, belowFoldInfo)!==-1) { $(window).scrollTop($(thisInfo).offset().top) } else { $(window).scrollTop($('#hDocInfo').offset().top) } } const fastfacts=()=>{ let thisChart=location.hash; ffToggles(thisChart); $('.chartNext,.chartPrevious, .ui-corner-top a, .chartSidebar a').on('click', function() { thisChart=$(this).attr('href'); ffToggles(thisChart); return false; }); $('.abbr a').on('click', function() { $('#abbreviations').toggle(); return false }); } $(function() { fastfacts() });