1(function ($) { 2 $(document).ready(function () { 3 openNav(); 4 closeNav(); 5 adjustMenuSocialIcons(); 6 topMenuClicks(); 7 sideMenuClicks(); 8 siteMenus(); 9 //homeEditionsDropdownShowHide(); 10 }); 11 $(window).on("load", function () { 12 13 }); 14 $(window).on('resize', function () { 15 siteMenus(); 16 topMenuClicks(); 17 homeEditionsDropdownShowHide(); 18 }); 19 20 function openNav() { 21 $('.menu_btn_wrapper').unbind('click').on('click', function () { 22 $('#site_wrapper, #main_sidenav, #header_wrapper').toggleClass('drawer_open'); 23 }); 24 } 25 26 function closeNav() { 27 $('.closebtn').unbind('click').on('click', function () { 28 $('#site_wrapper, #main_sidenav, #header_wrapper').removeClass('drawer_open'); 29 }); 30 } 31 32 function adjustMenuSocialIcons() { 33 if ($('.social_item').length > 1) { 34 $('.social_item').first().css('margin-left', '20px'); 35 $('.social_item').last().css('margin-right', '20px'); 36 } 37 } 38 function topMenuClicks() { 39 $(".top_menu_header_item .top_menu_parent").unbind('click').on("click", function (e) { 40 var $this_menuitem = $(this); 41 if ($($this_menuitem).attr("href") == "" || $($this_menuitem).attr("href") == "#") { 42 // Prevent default anchor click behavior 43 e.preventDefault(); 44 } 45 var this_menu_dropdown = $($this_menuitem).next(".top_menu_dropdown"); 46 47 if ($(window).width() < 767) { 48 // add back buttons 49 var mob_backbtn = '<div class="top_menu_mobile_header"><i class="fal fa-chevron-left"></i>' + $($this_menuitem).text() + '</div>'; 50 var prepended_bckbtn = $(this_menu_dropdown).prepend(mob_backbtn); 51 $('.top_menu_dropdown .top_menu_mobile_header').unbind('click').on('click', function () { 52 if ($('.top_menu_dropdown').hasClass('open')) { 53 $('.top_menu_dropdown').removeClass('open'); 54 setTimeout(function () { 55 $('.top_menu_dropdown').fadeOut(350); 56 $('.top_menu_dropdown .top_menu_mobile_header').remove(); 57 }, 350); 58 } 59 }); 60 } 61 62 if ($('.top_menu_dropdown').not(this_menu_dropdown).hasClass('open')) { 63 $('.top_menu_dropdown').not(this_menu_dropdown).fadeOut(350).removeClass('open'); 64 } 65 if (this_menu_dropdown) { 66 $(this_menu_dropdown).fadeToggle(350).toggleClass('open'); 67 } 68 69 }); 70 71 72 73 // edition click - had to add the luther_courses_body class due to conflicting js from courses 74 $('body:not(.luther_courses_body) .current_edition').unbind('click').on('click', function (e) { 75 $(this).parent().parent().find('.editions_wrapper').toggleClass('open'); 76 $(this).parent().find('.edition_list').fadeToggle(350); 77 }); 78 79 $('.editions_closebtn').unbind('click').on('click', function () { 80 $('.editions_wrapper').removeClass('open'); 81 $('.edition_list').fadeOut(350); 82 }); 83 84 $(document).unbind('click').on("click", function (e) { 85 var header = $(".header_wrapper"); 86 if (!header.is(e.target) // if the target of the click isn't the container... 87 && header.has(e.target).length === 0) { // ... nor a descendant of the container 88 if ($('.top_menu_dropdown').hasClass('open')) { 89 $('.top_menu_dropdown').fadeOut(350).removeClass('open'); 90 } 91 92 if ($('.header_editions_wrapper .editions_wrapper').hasClass('open')) { 93 $('.header_editions_wrapper .editions_wrapper').toggleClass('open'); 94 $('.header_editions_wrapper .edition_list').fadeToggle(350); 95 } 96 } 97 }); 98 } 99 function sideMenuClicks() { 100 $(".side_menu_items .side_menu_parent").unbind('click').on("click", function (e) { 101 var $this_menuitem = $(this); 102 if ($($this_menuitem).attr("href") == "" || $($this_menuitem).attr("href") == "#") { 103 // Prevent default anchor click behavior 104 e.preventDefault(); 105 } 106 var this_menu_dropdown = $($this_menuitem).next(".side_menu_child_items_wrapper"); 107 108 // add back buttons 109 var mob_backbtn = '<div class="side_menu_mobile_header"><i class="fal fa-chevron-left"></i><span>' + $($this_menuitem).text() + '</span></div>'; 110 var prepended_bckbtn = $(this_menu_dropdown).prepend(mob_backbtn); 111 $('.side_menu_child_items_wrapper .side_menu_mobile_header').unbind('click').on('click', function () { 112 if ($('.side_menu_child_items_wrapper').hasClass('open')) { 113 $('.side_menu_child_items_wrapper').removeClass('open'); 114 setTimeout(function () { 115 $('.side_menu_child_items_wrapper .side_menu_mobile_header').remove(); 116 }, 350); 117 } 118 }); 119 120 if ($('.side_menu_child_items_wrapper').not(this_menu_dropdown).hasClass('open')) { 121 $('.side_menu_child_items_wrapper').not(this_menu_dropdown).fadeOut(350).removeClass('open'); 122 } 123 if (this_menu_dropdown) { 124 $(this_menu_dropdown).toggleClass('open'); 125 } 126 127 }); 128 } 129 function siteMenus() { 130 131 $('.mobile_ham').unbind('click').on('click', function () { 132 $('.ham_menu, .top_menu').toggleClass('active'); 133 $('html, body').toggleClass('menu-open'); 134 }); 135 //adding gradient if overflowing 136 if ($('#side_menu').length > 0) { 137 if (isOverflown($('#side_menu')[0])) { 138 $('#side_menu').addClass('overflowing'); 139 } else { 140 $('#side_menu').removeClass('overflowing'); 141 } 142 } 143 if ($('.side_menu_child_items_wrapper').length > 0) { 144 var overflow_div = '<div class="overflow_gradient"></div>'; 145 $('.side_menu_child_items_wrapper').each(function () { 146 if (isOverflown(this) && $(this).parent().children('.overflow_gradient').length <= 0) { 147 $(this).parent().append(overflow_div); 148 } 149 if (!isOverflown(this) && $(this).parent().children('.overflow_gradient').length > 0) { 150 $('.overflow_gradient').remove(); 151 } 152 }); 153 } 154 if ($(window).width() < 767) { 155 // Top Menus 156 157 } else if ($(window).width() >= 767) { 158 159 } 160 } 161 function isOverflown(element) { 162 return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth; 163 } 164 function homeEditionsDropdownShowHide() { 165 if ($('.home_page').length > 0) { 166 167 window.onscroll = function () { handleEditionsVisibility() }; 168 169 if ($(window).width() >= 768) { 170 $('.header_editions_wrapper').fadeOut(0); 171 } else { 172 $('.header_editions_wrapper').fadeIn(200); 173 } 174 var home_editions_dd = document.getElementsByClassName("home_editions_dropdown"); 175 var home_editions_dd_pos = home_editions_dd[0].offsetTop; 176 177 function handleEditionsVisibility() { 178 if ($(window).width() >= 768) { 179 180 if (window.pageYOffset > home_editions_dd_pos) { 181 $('.header_editions_wrapper').fadeIn(200); 182 183 } else { 184 $('.header_editions_wrapper').fadeOut(200); 185 } 186 } else { 187 $('.header_editions_wrapper').fadeIn(); 188 } 189 } 190 191 192 } 193 } 194})(jQuery);
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.