1 2$(function(){ 3 4 // // Cover photos 5 $('.cover-photo').each(function(){ 6 $(this).css("background-image", "url("+$(this).data('src')+")"); 7 }); 8 9 // // Polls 10 $('.poll-form .vote button').click(function(){ 11 form = $(this).closest('.poll-form'); 12 if( form.serialize() != '' ){ 13 form.submit(); 14 } 15 }); 16 17 // Nav 18 $('.navigation .parent').mouseenter(function(){ 19 $(this).find('.children').show(); 20 }).mouseleave(function(){ 21 $(this).find('.children').hide(); 22 }); 23 24 // Gallery widget 25 $('.box-content-gallery .carousel').on('slide.bs.carousel', function(e){ 26 var target = $(e.relatedTarget); 27 var container = target.closest('.box-content-gallery'); 28 container.find('.thumbnails li').removeClass('active'); 29 container.find('.thumbnails li[data-slide-to='+target.data('item')+']').addClass('active'); 30 }); 31 $('.box-content-gallery .thumbnails li').click(function(){ 32 var container = $(this).closest('.box-content-gallery'); 33 container.find('.carousel').carousel('pause'); 34 }); 35 $('.box-content-gallery .carousel .canvas').mouseenter(function(){ 36 $(this).find('.carousel-caption').fadeIn('fast'); 37 }); 38 $('.box-content-gallery .carousel .canvas').mouseleave(function(){ 39 $(this).find('.carousel-caption').fadeOut('fast'); 40 }); 41 42 // Auto height 43 window.setTimeout(function(){ 44 $('.autoheight-group').each(function(){ 45 $(this).find('.autoheight').height( parseInt($(this).height()) - 40 ); 46 }) 47 }, 48 2000 49 ); 50 51 // Mobile subnav toggle 52 $('.mobile-subnav-icon').click(function(){ 53 if( $(this).data('toggled') ){ 54 $('.mobile-subnav-item-'+$(this).data('navitem')).slideUp('fast'); 55 $(this).removeClass('fa-minus').addClass('fa-plus').data('toggled',false); 56 }else{ 57 $('.mobile-subnav-item-'+$(this).data('navitem')).slideDown('fast'); 58 $(this).removeClass('fa-plus').addClass('fa-minus').data('toggled',true); 59 } 60 }); 61 62 // Link away 63 // $(function(){ 64 // $('a').each(function(){ 65 // var href = $(this).attr('href'); 66 // if( typeof href != 'string' ){ 67 // return; 68 // } 69 // if( $(this).attr('href').indexOf('http') == 0 ){ 70 // $(this).prop('target','new'); 71 // } 72 // }); 73 // }); 74 75 76 77}); 78 79 80 81function fitSliderArrow(slide) 82{ 83 84 var carousel = slide.closest('.carousel'); 85 var arrow = carousel.find('.right-arrow'); 86 87 /* This just places the arrow on the right */ 88 arrow.css('right','0'); 89 90 /* This fits the arrow to the edge of the image 91 var img = slide.find('img'); 92 if( img.length > 0 ){ 93 var imgRightEdge = img.offset().left + img.outerWidth(); 94 var container = img.closest('.photo'); 95 var containerRightEdge = container.offset().left + container.outerWidth(); 96 var difference = containerRightEdge - imgRightEdge; 97 if( difference > 0 ){ 98 arrow.css('right', difference+'px'); 99 }else{ 100 arrow.css('right','0'); 101 } 102 }else{ 103 arrow.css('right','0'); 104 } */ 105 106 carousel.find('.arrows').show(); 107 108}
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.