1/* 2 * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. 3 */ 4(function(){ 5 // Fix flickering in storefront when image.src=undefined 6 if (window.Imager) { 7 Imager.prototype.replaceImagesBasedOnScreenDimensions = function(image) { 8 var availableWidths = [], srcARRAY, cwidth; 9 const DATA_MEDIA = "data-media"; 10 11 if ($(image).attr(DATA_MEDIA) !== undefined) { 12 var eMedia = $(image).attr(DATA_MEDIA); 13 $(image).removeAttr(DATA_MEDIA); 14 eMedia = $.parseJSON(eMedia); 15 $.each(eMedia, function(key, value) { 16 availableWidths.push(parseInt(key)); 17 }); 18 $(image).data("width", availableWidths); 19 $(image).data("media", eMedia); 20 } 21 22 srcARRAY = $(image).data("media"); 23 cwidth = Imager.getClosestValue(window.innerWidth, $.extend([], $(image).data("width"))); 24 25 if (!srcARRAY[cwidth] || image.src == srcARRAY[cwidth]) { 26 return; 27 } 28 image.src = srcARRAY[cwidth]; 29 }; 30 } 31 32 window.smartedit.addOnReprocessPageListener(function() { 33 34 // reinitializing the list of images processed through the Imager object 35 ACC.global.initImager(); 36 37 // replacing images according to screen size, when required 38 ACC.global.reprocessImages(); 39 40 // replaying the my account nav only if it has been swapped by new component 41 if ($(".navigation--top .myAccountLinksHeader").length === 0) { 42 $('.js-myAccount-root').empty(); 43 $(".js-secondaryNavAccount > ul").empty(); 44 ACC.navigation.myAccountNavigation(); 45 } 46 47 // Make sure the carousel component is reloaded properly after re-rendering. 48 ACC.carousel.bindCarousel(); 49 50 // Make sure SearchBox Component is reloaded properly after re-rendering. 51 ACC.autocomplete.bindSearchAutocomplete(); 52 }); 53 54})();
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.