Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. function getSvgMainImage(id, useRendition, imgPath, title, alt, width, height, zoom, position, top, bottom, left, right) {
  2. if (imgPath !== '' && useRendition === 'false') {
  3. let component = utils.image().getImage(imgPath);
  4. let fullId = 'noRenditionImage-' + id;
  5. let full = '#noRenditionImage-' + id;
  6.  
  7. $(component).attr('id', fullId);
  8. $(component).css('position', position);
  9. $(component).css('top', top);
  10. $(component).css('bottom', bottom);
  11. $(component).css('left', left);
  12. $(component).css('right', right);
  13. $(component).css('max-width', '100%');
  14. $(component).width(width);
  15. $(component).height(height);
  16. $(component).attr('preserveAspectRatio', 'xMidYMid slice');
  17.  
  18. if( isParentHeroBanner('noRenditionImage-' + id) ){
  19. console.log('rodou');
  20. console.log(this);
  21. $(this).addClass('testando');
  22. $(this).removeAttr('preserveAspectRatio');
  23. }
  24.  
  25. if (isParentPromoTileComponent('imageNoRendition-' + id)) {
  26. $('#imageNoRendition-' + id).css('width', '100%');
  27. $(component).css('width', '100%');
  28. $(component).css('max-height', '100%');
  29. }
  30.  
  31. if (zoom === 'true') {
  32. $(component).addClass('segmentation__image');
  33. }
  34.  
  35. $('#imageNoRendition-' + id).prepend(component);
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement