1(function ($) { 2 3 $(document).ready(function () { 4 5 /* Hide empty social icons */ 6 $('.social-icons li').each(function () { 7 8 var url = $(this).find('a').attr('href'); 9 10 if (url === '') { 11 $(this).hide(); 12 } 13 14 }); 15 16 /* Mobile navigation */ 17 $('.nav-toggle').click(function () { 18 19 $('#main-menu div ul:first-child').slideToggle(250); 20 21 return false; 22 23 }); 24 25 /* Desktop menu */ 26 if (($(window).width() > 640) || ($(document).width() > 640)) { 27 28 $('#main-menu li') 29 30 .on('mouseenter focusin', function () { 31 32 $(this) 33 .children('ul') 34 .stop(true, true) 35 .slideDown(200) 36 .css('display', 'block'); 37 38 }) 39 40 .on('mouseleave focusout', function () { 41 42 var $this = $(this); 43 44 setTimeout(function () { 45 46 if (!$this.find(':focus').length) { 47 48 $this 49 .children('ul') 50 .stop(true, true) 51 .slideUp(200); 52 53 } 54 55 }, 100); 56 57 }); 58 59 } 60 61 /* Mobile dropdown */ 62 else { 63 64 $('#main-menu li').each(function () { 65 66 if ($(this).children('ul').length) { 67 68 $(this).append( 69 '<span class="drop-down-toggle"><span class="drop-down-arrow"></span></span>' 70 ); 71 72 } 73 74 }); 75 76 $('.drop-down-toggle').click(function () { 77 78 $(this) 79 .parent() 80 .children('ul') 81 .slideToggle(250); 82 83 }); 84 85 } 86 87 }); 88 89})(jQuery); 90 91 92 93/* =========================================================== 94 ACCESSIBILITY MENU 95=========================================================== */ 96 97(function ($) { 98 99 Drupal.behaviors.fixAccessibilityMenu = { 100 101 attach: function (context) { 102 103 $('.ico-accessibility ul', context) 104 105 .once('fix-accessibility') 106 107 .css({ 108 visibility: '', 109 opacity: '1' 110 }); 111 112 $('#toggleAccessibility', context) 113 114 .once('toggleAccessibility') 115 116 .on('keydown', function (e) { 117 118 if (e.key === 'Enter' || e.key === ' ') { 119 120 e.preventDefault(); 121 122 $(this).parent().toggleClass('open'); 123 124 } 125 126 }); 127 128 } 129 130 }; 131 132})(jQuery); 133 134 135 136/* =========================================================== 137 MAIN MENU KEYBOARD SUPPORT 138=========================================================== */ 139 140(function ($) { 141 142 Drupal.behaviors.menuA11yFix = { 143 144 attach: function (context) { 145 146 $('.menu li.expanded', context) 147 148 .once('menuA11yFix') 149 150 .each(function () { 151 152 var $parent = $(this); 153 var $submenu = $parent.children('ul'); 154 155 if (!$submenu.length) { 156 return; 157 } 158 159 $submenu.hide(); 160 161 $submenu.find('a').attr('tabindex', '-1'); 162 163 $parent.on('focusin mouseenter', function () { 164 165 $parent.addClass('hover menu-open'); 166 167 $submenu.css({ 168 display: 'block', 169 opacity: '1', 170 visibility: 'visible', 171 pointerEvents: 'auto', 172 transform: 'translateY(0)' 173 }); 174 175 $submenu.find('a').attr('tabindex', '0'); 176 177 }); 178 179 $parent.on('mouseleave focusout', function () { 180 181 var current = $parent; 182 183 setTimeout(function () { 184 185 if (!current.find(':focus').length) { 186 187 current.removeClass('hover menu-open'); 188 189 $submenu.css({ 190 display: 'none', 191 opacity: '0', 192 pointerEvents: 'none' 193 }); 194 195 $submenu.find('a').attr('tabindex', '-1'); 196 197 } 198 199 }, 150); 200 201 }); 202 203 }); 204 205 } 206 207 }; 208 209})(jQuery); 210 211 212 213/* =========================================================== 214 QUICKTABS KEYBOARD 215=========================================================== */ 216 217(function ($) { 218 219 Drupal.behaviors.quicktabsKeyboardFix = { 220 221 attach: function (context) { 222 223 function fixTabs() { 224 225 $('.quicktabs-tab', context).each(function () { 226 227 $(this).attr('tabindex', '0'); 228 229 }); 230 231 } 232 233 fixTabs(); 234 235 $('.quicktabs-tab', context) 236 237 .off('click.keyboardfix') 238 239 .on('click.keyboardfix', function () { 240 241 setTimeout(fixTabs, 100); 242 243 }); 244 245 } 246 247 }; 248 249})(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.