1(function ($) { 2 3 'use strict'; 4 5 const $logo = $('.thegem-te-logo'); 6 const tabletLandscapeMaxWidth = 1212; 7 const tabletLandscapeMinWidth = 980; 8 const tabletPortraitMaxWidth = 979 9 const tabletPortraitMinWidth = 768; 10 11 const logoScripts = { 12 init: () => { 13 logoScripts.setLayoutView(); 14 logoScripts.onResize(); 15 }, 16 17 setLayoutView: () => { 18 let viewportWidth = window.innerWidth; 19 20 $logo.each(function (i, el) { 21 if ($(this).data("tablet-landscape") === 'default' && viewportWidth >= tabletLandscapeMinWidth && viewportWidth <= tabletLandscapeMaxWidth) { 22 $(this).removeClass('mobile-view').addClass('desktop-view'); 23 } else if ($(this).data("tablet-portrait") === 'default' && viewportWidth >= tabletPortraitMinWidth && viewportWidth <= tabletPortraitMaxWidth) { 24 $(this).removeClass('mobile-view').addClass('desktop-view'); 25 } else if (viewportWidth <= tabletLandscapeMaxWidth) { 26 $(this).removeClass('desktop-view').addClass('mobile-view'); 27 } else { 28 $(this).removeClass('mobile-view').addClass('desktop-view'); 29 } 30 }); 31 }, 32 33 onResize: () => { 34 let resizeTimer; 35 $(window).on('resize', function(e) { 36 clearTimeout(resizeTimer); 37 38 resizeTimer = setTimeout(function() { 39 logoScripts.setLayoutView(); 40 }, 250); 41 }); 42 }, 43 } 44 45 // Run the function 46 $(function () { 47 logoScripts.init(); 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.