1/************************** 2 * 3 * document ready functions 4 * 5 *************************/ 6 7(function ($) { 8 9 'use strict'; 10 11 $(document).ready(function () { 12 $('.shoppable-image').each(function() { 13 shoppable_image($(this)); 14 }); 15 16 $('body').on('shoppableImages', function(e, $content) { 17 $content.find('.shoppable-image').each(function() { 18 shoppable_image($(this)); 19 }); 20 }); 21 }); 22 23 var shoppable_image = function (ThisImagemap) { 24 if (ThisImagemap.data('aceShoppableImageLoaded')) { 25 return; 26 } 27 28 var 29 Map = ThisImagemap.find('.shoppable-image-map'), 30 HideBtn = ThisImagemap.find('.shoppable-image-hideshow-btn'); 31 new Waypoint({ 32 element: ThisImagemap, 33 handler: function (direction) { 34 if (direction === 'down') { 35 ThisImagemap.addClass('pins-visible'); 36 } else { 37 ThisImagemap.removeClass('pins-visible'); 38 } 39 }, 40 offset : '80%' 41 }); 42 HideBtn.click(function(e){ 43 e.preventDefault(); 44 Map.toggleClass('hide-pins'); 45 }); 46 shoppable_image_resize(ThisImagemap); 47 $(window).resize(function () { 48 shoppable_image_resize(ThisImagemap); 49 }); 50 51 ThisImagemap.data('aceShoppableImageLoaded', true); 52 }; 53 54 var shoppable_image_resize = function(ThisImagemap){ 55 var 56 Pins = ThisImagemap.find('.shoppable-image-pin'); 57 Pins.each(function(){ 58 var 59 ThisPinBody = $(this).find('.shoppable-image-pin-body'); 60 ThisPinBody.css({ "margin-left": "auto" }); 61 var 62 BodyRect = ThisPinBody[0].getBoundingClientRect(), 63 OffsetLeft = BodyRect.x, 64 OffsetRight = ( BodyRect.x + BodyRect.width ) - window.innerWidth; 65 if( OffsetLeft < 0 ) { 66 ThisPinBody.css({ "margin-left": -OffsetLeft + 'px' }); 67 } 68 if ( OffsetRight > 0 ) { 69 ThisPinBody.css({ "margin-left": -OffsetRight + 'px' }); 70 } 71 }); 72 }; 73 74})(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.