1var bit = bit || {}; 2 3bit.cookies = (function ($) { 4 var header = $('.js--heading'), 5 cookies = $('.js--cookies'), 6 wrapper = $('.js--wrapper'), 7 search = $('.js--offcanvas-search'), 8 toggle = $('*'), 9 body = $('body'), 10 h = header.outerHeight(), 11 s = search.outerHeight(), 12 c = cookies.outerHeight(), 13 event = bit.device.device ? 'touchend' : 'click', 14 condition = bit.device.device && body.hasClass('is--cookies'), 15 16 setHeader = function () { 17 if (header.hasClass('is--shown')) { 18 if (bit.device.screen) { 19 search.css('top', c); 20 } else { 21 header.css('top', c); 22 } 23 } else { 24 header.css('top', ''); 25 search.css('top', ''); 26 } 27 }, 28 29 state = function () { 30 var v = bit.device.screen ? s + h : c + h; 31 if (condition) { 32 setHeader(); 33 wrapper.css('padding-top', v); 34 } 35 }, 36 37 scroll = function () { 38 if (condition) { 39 $(window).on('scroll.cookies', function () { 40 setHeader(); 41 }); 42 } 43 }, 44 45 hendlerBanner = function () { 46 body.removeClass('is--cookies'); 47 if (condition) { 48 wrapper.css('padding-top', ''); 49 if (bit.device.screen) { 50 search.css('top', ''); 51 } else { 52 header.css('top', ''); 53 } 54 $(window).unbind('scroll.cookies'); 55 } 56 }, 57 58 handlerClick = function () { 59 toggle.on(event, function () { 60 hendlerBanner(); 61 }); 62 }, 63 64 handlerScroll = function () { 65 $(window).on('scroll', function () { 66 hendlerBanner(); 67 }); 68 }, 69 70 init = function () { 71 state(); 72 scroll(); 73 handlerClick(); 74 handlerScroll(); 75 }; 76 77 return { 78 init: init() 79 }; 80 81})(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.