Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
cornerstone/js/header-widgets.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20 lines (15 sloc)
1.04 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function( $ ) { | |
if ($("#masthead .col-sm-4 .widget")[0]){ //if a widget exists in the header area | |
$("#masthead .col-sm-4 .searchform").hide(); // hide default search | |
$("#masthead .col-sm-4").removeClass( "col-sm-4" ).addClass( "col-sm-6" ); // make old search wrapper larger | |
$("#masthead .col-sm-8").removeClass( "col-sm-8" ).addClass( "col-sm-6" ); //change site title area since search area is now larger | |
$("#masthead .col-sm-6 .widget .searchform").show(); // allow search widget to be showed when added to search area | |
var $widget = $('#masthead .col-sm-6 .widget'); | |
$widget.css('width',(100/$widget.length).toString()+'%'); | |
//$widget.css('width', '50%'); | |
var $widgetMenuHeight = $('#masthead .col-sm-6 .widget .menu'); //Center menu widget | |
$widgetMenuHeight.css('margin-top', ($('#uc-site-header').outerHeight() - $('#masthead .col-sm-6 .widget .menu li a').outerHeight())/2); | |
} else { //if no widget exists | |
$("#masthead .col-sm-4.widget").removeClass("col-sm-4").hide(); | |
} | |
}); |