1/** 2 * @file 3 * Provides responsive menu toggle and dropdown functionality. 4 */ 5 6(function ($) { 7 Drupal.behaviors.responsiveDropdownMenuToggle = { 8 attach: function(context, settings) { 9 10 var responsiveDropdownMenus = Drupal.settings.responsive_dropdown_menus; 11 var menuToggleHelper = Drupal.t('Menu'); 12 13 // Cycle through responsive dropdown menu blocks. 14 $('.responsive-menu', context).each(function(index) { 15 var menuID = $(this).attr('id'); 16 17 // Check if delta equals the element's ID. 18 $.each(responsiveDropdownMenus, function(delta, title) { 19 if(delta == menuID) { 20 menuToggleHelper = title; 21 } 22 }); 23 if(!$(this).prev().hasClass('menu-toggle')) { 24 // Drop in our menu toggle. 25 var title = Drupal.t('Toggle Menu'); 26 $(this).before('<a class="menu-toggle" title="' + title + '"><span class="lines"><span class="line first-line first"></span><span class="line"></span><span class="line last-line last"></span></span><span class="toggle-help">' + menuToggleHelper + '</span></a>'); 27 } 28 }); 29 30 // Bind click event to toggle. 31 $('.menu-toggle').click(function(){ 32 $(this).next().toggleClass('menu-toggled'); 33 }); 34 } 35 }; 36 37 Drupal.behaviors.responsiveDropdownMenuDropDown = { 38 attach: function(context) { 39 $('.responsive-menu li.menu-parent').hover( 40 function() { 41 $(this).children('.sub-menu').addClass('active'); 42 }, 43 function() { 44 $(this).children('.sub-menu').removeClass('active'); 45 } 46 ); 47 } 48 } 49})(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.