api-site/www/static/common/js/navigation.js
Russell Sim 68b1f1e748 Refresh index to match docs.openstack.org
Added tools/build-index.sh which will build an index.html and copy
needed static files into publish-docs/www

Change-Id: If65a9da675a182f0aab659cb076c3a4aba032b58
2016-01-07 13:47:04 -06:00

66 lines
2.0 KiB
JavaScript

// Open header search bar
$(function() {
$(".search-icon").click(function() {
$(".navbar-main").toggleClass("show");
$(".search-container").toggleClass("show");
$(".search-icon").toggleClass("show");
$('#gsc-i-id1').focus();
});
});
// Close header search bar
$(function() {
$(".close-search").click(function() {
$(".navbar-main").toggleClass("show");
$(".search-container").toggleClass("show");
$(".search-icon").toggleClass("show");
});
});
// Open header drop downs on hover
jQuery(document).ready(function(){
if (jQuery(window).width() > 767) {
$('ul.navbar-main li ul.dropdown-menu').addClass('dropdown-hover');
$('ul.navbar-main li').hover(function() {
$(this).find('.dropdown-hover').stop(true, true).delay(400).fadeIn(100);
}, function() {
$(this).find('.dropdown-hover').stop(true, true).delay(100).fadeOut(200);
});
} else {
$('ul.navbar-main li ul.dropdown-menu').removeClass('dropdown-hover');
}
});
jQuery(window).resize(function () {
if (jQuery(window).width() > 767) {
$('ul.navbar-main li ul.dropdown-menu').addClass('dropdown-hover');
$('ul.navbar-main li').hover(function() {
$(this).find('.dropdown-hover').stop(true, true).delay(400).fadeIn(100);
}, function() {
$(this).find('.dropdown-hover').stop(true, true).delay(100).fadeOut(200);
});
} else {
$('ul.navbar-main li ul.dropdown-menu').removeClass('dropdown-hover');
}
});
// Remove Search text in smaller browser windows
jQuery(document).ready(function(){
if (jQuery(window).width() < 1050) {
$('#search-label').text('');
} else {
$('#search-label').text('Search');
}
});
jQuery(window).resize(function () {
if (jQuery(window).width() < 1050) {
$('#search-label').text('');
} else {
$('#search-label').text('Search');
}
});
// Show placeholder text in Google Search
setTimeout( function() {
$(".gsc-input").attr("placeholder", "search openstack");
}, 1000 );