PageSourceSearch

https://www.openstack.org/themes/openstack/javascript/navigation.js?m=1484877364

js openstack.org collected 2026-09-24 07:44:03 UTC 3,792 bytes, 108 lines download raw bytes

1/**
2 * Copyright 2014 Openstack Foundation
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
7 * Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS,
9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 * See the License for the specific language governing permissions and
11 * limitations under the License.
12 **/
13// Open header drop downs on hover
14jQuery(document).ready(function($){
15
16    if ($(window).width() > 767) {
17        $('ul.navbar-main li ul.dropdown-menu').addClass('dropdown-hover');
18        $("ul.navbar-main li").on("mouseenter",function() {
19          $(this).find('.dropdown-hover').stop(true, true).delay(400).fadeIn(100);
20      }).on("mouseleave", function() {
21          $(this).find('.dropdown-hover').stop(true, true).delay(100).fadeOut(200);
22      });
23    } else {
24        $('ul.navbar-main li ul.dropdown-menu').removeClass('dropdown-hover');
25    }
26
27    // Close header search bar
28    $("body").on("click", ".ossw-search-bar-close", function() {
29        $(".navbar-main").toggleClass("show");
30        $(".search-container").removeClass("show")
31        $(".search-icon").toggleClass("show");
32    });
33
34    // Open header search bar
35    $(".search-icon").on("click", function() {
36        $(".navbar-main").toggleClass("show");
37        $(".search-container").toggleClass("show");
38        $("input", '.openstack-search-bar').first().focus();
39        $(".search-icon").toggleClass("show");
40    });
41
42    $(window).on("resize", function () {
43        if ($(window).width() > 767) {
44            $('ul.navbar-main li ul.dropdown-menu').addClass('dropdown-hover');
45            $('ul.navbar-main li').hover(function() {
46                $(this).find('.dropdown-hover').stop(true, true).delay(400).fadeIn(100);
47            }, function() {
48                $(this).find('.dropdown-hover').stop(true, true).delay(100).fadeOut(200);
49            });
50        } else {
51            $('ul.navbar-main li ul.dropdown-menu').removeClass('dropdown-hover');
52        }
53        if ($(window).width() < 1050) {
54            $('#search-label').text('');
55        } else {
56            $('#search-label').text('Search');
57        }
58    });
59
60    // Remove Search text in smaller browser windows
61    if ($(window).width() < 1050) {
62        $('#search-label').text('');
63    } else {
64        $('#search-label').text('Search');
65    }
66	
67    // Toggle mobile header nav dropdowns
68    $("i.mobile-expand").on("click", function (event) {
69        if ($(this).closest('li').hasClass("open")) {
70            $('li').removeClass('open');
71        } else {
72            $('li').not(this).closest('li').removeClass('open');
73            $(this).closest('li').toggleClass('open');
74        }
75        event.preventDefault();
76    });
77});
78
79// Remove open class when window is resized
80jQuery(window).on("resize",function () {
81    if (jQuery(window).width() > 767) {
82        $("li").removeClass("open");
83    }
84});
85
86// Global Nav UI Tracking
87
88jQuery(document).ready(function($) {
89    $(document).on("click", ".project___1BAp9", function(){
90        var href  = $(this).attr('href');
91        ga('send', 'event', {
92            eventCategory: 'Global UI Navigation',
93            eventAction: 'Click',
94            eventLabel: href
95        });
96    });
97});
98
99jQuery(document).ready(function($) {
100    $(document).on("click", "#vancouver-banner-btn", function(){
101        var href  = $(this).attr('href');
102        ga('send', 'event', {
103            eventCategory: 'Summit Banner',
104            eventAction: 'Click',
105            eventLabel: href
106        });
107    });
108});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.