1/*Menu Dropdown Onhover Js*/ 2 jQuery(document).ready(function() { 3 4 /* ---------------------------------------------- /* 5 * Initialization General Scripts for all pages 6 /* ---------------------------------------------- */ 7 8 var navbar = jQuery('.navbar-default'), 9 navHeight = navbar.height(), 10 // worksgrid = jQuery('#works-grid'), 11 width = Math.max(jQuery(window).width(), window.innerWidth), 12 mobileTest = false; 13 14 if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 15 mobileTest = true; 16 } 17 18 document.onload = busiprof_load_menu(); 19 busiprof_hoverDropdown(width, mobileTest); 20 busiprof_navbarSubmenu(width); 21 jQuery(window).resize(function() { 22 var width = Math.max(jQuery(window).width(), window.innerWidth); 23 busiprof_hoverDropdown(width, mobileTest); 24 }); 25 26 function busiprof_load_menu () { 27 jQuery('.dropdown-menu').parent().addClass('dropdown'); 28 jQuery('.dropdown-menu > li > .dropdown-menu').parent().addClass('dropdown-submenu'); 29 } 30 31 /* ---------------------------------------------- /* 32 * Navbar submenu 33 /* ---------------------------------------------- */ 34 35 function busiprof_navbarSubmenu(width) { 36 if ((width > 1100) && (mobileTest !== true)) { 37 jQuery('.navbar-default .navbar-nav > li.dropdown').hover(function() { 38 var MenuLeftOffset = jQuery(this).offset().left; 39 var Menu1LevelWidth = jQuery('.dropdown-menu', jQuery(this)).width(); 40 if (width - MenuLeftOffset < Menu1LevelWidth * 2) { 41 jQuery(this).children('.dropdown-menu').addClass('leftauto'); 42 } else { 43 jQuery(this).children('.dropdown-menu').removeClass('leftauto'); 44 } 45 if (jQuery('.dropdown', jQuery(this)).length > 0) { 46 var Menu2LevelWidth = jQuery('.dropdown-menu', jQuery(this)).width(); 47 if (width - MenuLeftOffset - Menu1LevelWidth < Menu2LevelWidth) { 48 jQuery(this).children('.dropdown-menu').addClass('left-side'); 49 } else { 50 jQuery(this).children('.dropdown-menu').removeClass('left-side'); 51 } 52 } 53 }); 54 55 jQuery('.navbar-default .navbar-nav > li.dropdown a').focus(function() { 56 var MenuLeftOffsets = jQuery(this).parent().offset().left; 57 var Menu1LevelWidth = jQuery('.dropdown-menu', jQuery(this).parent()).width(); 58 if (width - MenuLeftOffsets < Menu1LevelWidth * 2) { 59 jQuery(this).parent().children('.dropdown-menu').addClass('leftauto'); 60 } else { 61 jQuery(this).parent().children('.dropdown-menu').removeClass('leftauto'); 62 } 63 if (jQuery('.dropdown', jQuery(this).parent()).length > 0) { 64 var Menu2LevelWidth = jQuery('.dropdown-menu', jQuery(this).parent()).width(); 65 if (width - MenuLeftOffsets - Menu1LevelWidth < Menu2LevelWidth) { 66 jQuery(this).parent().children('.dropdown-menu').addClass('left-side'); 67 } else { 68 jQuery(this).parent().children('.dropdown-menu').removeClass('left-side'); 69 } 70 } 71 }); 72 } 73 } 74 75 /* ---------------------------------------------- /* 76 * Navbar hover dropdown on desctop 77 /* ---------------------------------------------- */ 78 79 function busiprof_hoverDropdown(width, mobileTest) { 80 if ((width > 1100) && (mobileTest !== true)) { 81 jQuery('.dropdown-menu').removeAttr("style"); 82 var delay = 0; 83 var setTimeoutConst; 84 jQuery('.navbar-default .navbar-nav > li.dropdown, .navbar-default li.dropdown > .dropdown-menu li.dropdown-submenu').hover(function() { 85 var jQuerythis = jQuery(this); 86 setTimeoutConst = setTimeout(function() { 87 jQuerythis.addClass('open'); 88 jQuerythis.find('.dropdown-toggle').addClass('disabled'); 89 }, delay); 90 }, 91 function() { 92 clearTimeout(setTimeoutConst); 93 jQuery(this).removeClass('open'); 94 jQuery(this).find('.dropdown-toggle').removeClass('disabled'); 95 }); 96 } else { 97 jQuery('.navbar-default .navbar-nav > li.dropdown, .navbar-default li.dropdown > .dropdown-menu li.dropdown-submenu').unbind('mouseenter mouseleave'); 98 jQuery('.navbar-default [data-toggle=dropdown]').not('.binded').addClass('binded').on('click', function(event) { 99 event.preventDefault(); 100 event.stopPropagation(); 101 jQuery(this).parent().siblings().removeClass('open'); 102 jQuery(this).parent().siblings().find('[data-toggle=dropdown]').parent().removeClass('open'); 103 jQuery(this).parent().toggleClass(); 104 }); 105 } 106 } 107 108 /* ---------------------------------------------- /* 109 * Navbar focus dropdown on desktop 110 /* ---------------------------------------------- */ 111 112 113 const topLevelLinks = Array.prototype.slice.call(document.querySelectorAll(".navbar-default .navbar-nav > li.dropdown a"), 0); 114 topLevelLinks.forEach(function(link) { 115 link.addEventListener('focus', function(e) { 116 this.parentElement.classList.add('open') 117 e.preventDefault(); 118 119 var div_list = e.target.parentElement.querySelectorAll( ".open" ); 120 var div_array = Array.prototype.slice.call(div_list); 121 div_array.forEach(function(e){ 122 return e.classList.remove( "open" ) 123 }) 124 }) 125 }) 126 127 jQuery('li a').focus(function() { 128 129 jQuery(this).parent().siblings().removeClass('open'); 130 131 }); 132 133 jQuery('a,input').bind('focus', function() { 134 if(!jQuery(this).closest(".menu-item").length ) { 135 topLevelLinks.forEach(function(link) { 136 link.parentElement.classList.remove('open') 137 }) 138 } 139 }) 140 141 jQuery('li.dropdown').find('.caret').each(function(){ 142 jQuery(this).on('click', function(){ 143 if( jQuery(window).width() <= 1100) { 144 jQuery('li.dropdown,li.dropdown-submenu').removeClass('open'); 145 jQuery(this).parent().next().slideToggle(); 146 } 147 return false;
148 }); 149 }); 150 jQuery('a,input').bind('focus', function() { 151 if(!jQuery(this).closest(".menu-item").length && ( jQuery(window).width() <= 1100) ) { 152 jQuery('.navbar-collapse').removeClass('show'); 153 }}) 154}); 155 156/* Page Scroll onclick button Js */ 157 jQuery(document).ready(function () { 158 159 jQuery(window).scroll(function () { 160 if (jQuery(this).scrollTop() > 100) { 161 jQuery('.scrollup').fadeIn(); 162 } else { 163 jQuery('.scrollup').fadeOut(); 164 } 165 }); 166 167 jQuery('.scrollup').click(function () { 168 jQuery("html, body").animate({ 169 scrollTop: 0 170 }, 500); 171 return false; 172 }); 173 174 }); 175 176 /* Tooltips on anchor Js */ 177 jQuery(function () { 178 jQuery('[data-toggle="tooltip"]').tooltip() 179 })
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.