Newer
Older
jQuery(document).ready(function(){
//set sidebar height to match height of content on page
if(jQuery(".page-node-type-page .main-container section").height() > jQuery(".page-node-type-page .main-container aside").height()) {
jQuery(".page-node-type-page .main-container aside").css({'height':(jQuery(".page-node-type-page .main-container section").height()+'px')});
}
//adds fontawesome arrow to menu
//check if is iPhone
function isiPhone(){
return (
(navigator.platform.indexOf("iPhone") != -1) ||
(navigator.platform.indexOf("iPod") != -1)
);
}
//check if menu in mobile view
if (jQuery('#superfish-main-accordion')[0]){
jQuery('.sf-accordion-button .svg-inline--fa').empty().replaceWith(function(){
Brian Canini
committed
return jQuery("<i class='fa fa-angle-down' aria-hidden='true' />").append(jQuery(this).contents());
});
//change arrow direction on click
jQuery('.sf-accordion-button').click(function(){
Brian Canini
committed
if ( jQuery(this).find("svg").hasClass('fa-angle-down') ) {
jQuery(this).find("svg").addClass( 'fa-angle-right' );
} else {
Brian Canini
committed
jQuery(this).find("svg").removeClass( 'fa-angle-right' ).addClass( 'fa-angle-down' );
Brian Canini
committed
if ( jQuery(this).find("i").hasClass('fa-angle-down') ) {
jQuery(this).find("i").removeClass('fa-angle-down').addClass( 'fa-angle-right' );
Brian Canini
committed
} else {
Brian Canini
committed
jQuery(this).find("i").removeClass( 'fa-angle-right' ).addClass( 'fa-angle-down' );
Brian Canini
committed
}
});
} else {
jQuery('.sf-sub-indicator').empty().replaceWith(function(){
return jQuery("<i class='fa fa-angle-right' aria-hidden='true' />").append(jQuery(this).contents());
});
}
//accordions change fontawesome character
jQuery(".panel-title").click(function(){
//jQuery(this).find("svg").toggleClass('fa-angle-up', addOrRemove);
if ( jQuery(this).find("svg").hasClass('fa-angle-down') ) {
jQuery(this).find("svg").addClass( 'fa-angle-up' );
} else {
jQuery(this).find("svg").removeClass( 'fa-angle-up' ).addClass( 'fa-angle-down' );
}
Brian Canini
committed
if ( jQuery(this).find("i").hasClass('fa-angle-down') ) {
jQuery(this).find("i").removeClass('fa-angle-down').addClass( 'fa-angle-up' );
} else {
jQuery(this).find("i").removeClass( 'fa-angle-up' ).addClass( 'fa-angle-down' );
}
});
//add class to last accordion in group
jQuery(".paragraph--type--accordion .panel:last-child").addClass( 'yell' );
Brian Canini
committed
//open search form in main menu
jQuery(".active-search").click(function() {
jQuery(".search-block-form").toggle();
jQuery(".search-block-form input[type='text']").focus();
});
//sets bgcolor for events, news, and people sections on homepage
if (jQuery(".region-events")[0] && jQuery(".region-people")[0]) {
jQuery( ".region-events" ).addClass( "block-bg-color" );
jQuery( ".region-people" ).addClass( "block-bg-color" );
}
if (jQuery(".region-news")[0] && !jQuery(".region-events")) {
jQuery( ".region-news" ).addClass( "block-bg-color" );
}
if (jQuery(".region-events")[0] && !jQuery(".region-news")) {
jQuery( ".region-events" ).addClass( "block-bg-color" );
}
if (!jQuery(".region-events") && !jQuery(".region-news")) {
jQuery( ".region-people" ).addClass( "block-bg-color" );
}
if (jQuery('.osu-logo2 img').is(':hidden')) {
jQuery('.osu-logo2').css('display','none');
jQuery('.osu-logo2-mobile').css('display','none');
} else {
jQuery('.osu-logo').css('display','none');
jQuery('.osu-logo-mobile').css('display','none');
}