1;(function ($, window, undefined){ 2 'use strict'; 3 4 $.fn.foundationAccordion = function (options) { 5 6 // DRY up the logic used to determine if the event logic should execute. 7 var hasHover = function(accordion) { 8 return accordion.hasClass('hover') && !Modernizr.touch 9 }; 10 11 $(document).on('mouseenter', '.accordion li', function () { 12 var p = $(this).parent(); 13 14 if (hasHover(p)) { 15 var flyout = $(this).children('.content').first(); 16 17 $('.content', p).not(flyout).hide().parent('li').removeClass('active'); 18 flyout.show(0, function () { 19 flyout.parent('li').addClass('active'); 20 }); 21 } 22 } 23 ); 24 25 $(document).on('click.fndtn', '.accordion li .title', function () { 26 var li = $(this).closest('li'), 27 p = li.parent(); 28 29 if(!hasHover(p)) { 30 var flyout = li.children('.content').first(); 31 32 if (li.hasClass('active')) { 33 p.find('li').removeClass('active').end().find('.content').hide(); 34 } else { 35 $('.content', p).not(flyout).hide().parent('li').removeClass('active'); 36 flyout.show(0, function () { 37 flyout.parent('li').addClass('active'); 38 }); 39 } 40 } 41 } 42 ); 43 44 }; 45 46})( jQuery, this ); 47
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.