Guest User

Untitled

a guest
Mar 22nd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.88 KB | None | 0 0
  1. <div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder">
  2. <div data-role="loader" class="loading-mask">
  3. <div class="loader">
  4.  
  5. <img src="<?php echo $block->getGalleryImages()->getFirstItem()->getData('medium_image_url') ?>" style="max-width: 100%; max-height: 100%">
  6.  
  7. <img src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"
  8. alt="<?php /* @escapeNotVerified */ echo __('Loading...') ?>">
  9. </div>
  10. </div>
  11. </div>
  12. <!--Fix for jumping content. Loader must be the same size as gallery.-->
  13. <script>
  14. var config = {
  15. "width": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'width'); ?>,
  16. "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height')
  17. ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>,
  18. "navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navtype"); ?>",
  19. "height": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'height'); ?>
  20. },
  21. thumbBarHeight = 0,
  22. loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0];
  23.  
  24. if (config.navtype === 'horizontal') {
  25. thumbBarHeight = config.thumbheight;
  26. }
  27.  
  28. loader.style.paddingBottom = ( config.height / config.width * 100) + "%";
  29. </script>
  30. <script type="text/x-magento-init">
  31. {
  32. "[data-gallery-role=gallery-placeholder]": {
  33. "mage/gallery/gallery": {
  34. "mixins":["magnifier/magnify"],
  35. "magnifierOpts": <?php /* @escapeNotVerified */ echo $block->getMagnifier(); ?>,
  36. "data": <?php /* @escapeNotVerified */ echo $block->getGalleryImagesJson(); ?>,
  37. "options": {
  38. "nav": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/nav"); ?>",
  39. <?php if (($block->getVar("gallery/loop"))): ?>
  40. "loop": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/loop"); ?>,
  41. <?php endif; ?>
  42. <?php if (($block->getVar("gallery/keyboard"))): ?>
  43. "keyboard": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/keyboard"); ?>,
  44. <?php endif; ?>
  45. <?php if (($block->getVar("gallery/arrows"))): ?>
  46. "arrows": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/arrows"); ?>,
  47. <?php endif; ?>
  48. <?php if (($block->getVar("gallery/allowfullscreen"))): ?>
  49. "allowfullscreen": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/allowfullscreen"); ?>,
  50. <?php endif; ?>
  51. <?php if (($block->getVar("gallery/caption"))): ?>
  52. "showCaption": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/caption"); ?>,
  53. <?php endif; ?>
  54. "width": "<?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'width'); ?>",
  55. "thumbwidth": "<?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'width'); ?>",
  56. <?php if ($block->getImageAttribute('product_page_image_small', 'height') || $block->getImageAttribute('product_page_image_small', 'width')): ?>
  57. "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height')
  58. ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>,
  59. <?php endif; ?>
  60. <?php if ($block->getImageAttribute('product_page_image_medium', 'height') || $block->getImageAttribute('product_page_image_medium', 'width')): ?>
  61. "height": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'height')
  62. ?: $block->getImageAttribute('product_page_image_medium', 'width'); ?>,
  63. <?php endif; ?>
  64. <?php if ($block->getVar("gallery/transition/duration")): ?>
  65. "transitionduration": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/transition/duration"); ?>,
  66. <?php endif; ?>
  67. "transition": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/transition/effect"); ?>",
  68. <?php if (($block->getVar("gallery/navarrows"))): ?>
  69. "navarrows": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/navarrows"); ?>,
  70. <?php endif; ?>
  71. "navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navtype"); ?>",
  72. "navdir": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navdir"); ?>"
  73. },
  74. "fullscreen": {
  75. "nav": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/nav"); ?>",
  76. <?php if ($block->getVar("gallery/fullscreen/loop")): ?>
  77. "loop": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/loop"); ?>,
  78. <?php endif; ?>
  79. "navdir": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/navdir"); ?>",
  80. <?php if ($block->getVar("gallery/transition/navarrows")): ?>
  81. "navarrows": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/navarrows"); ?>,
  82. <?php endif; ?>
  83. "navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/navtype"); ?>",
  84. <?php if ($block->getVar("gallery/fullscreen/arrows")): ?>
  85. "arrows": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/arrows"); ?>,
  86. <?php endif; ?>
  87. <?php if ($block->getVar("gallery/fullscreen/caption")): ?>
  88. "showCaption": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/caption"); ?>,
  89. <?php endif; ?>
  90. <?php if ($block->getVar("gallery/fullscreen/transition/duration")): ?>
  91. "transitionduration": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/transition/duration"); ?>,
  92. <?php endif; ?>
  93. "transition": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/fullscreen/transition/effect"); ?>"
  94. },
  95. "breakpoints": <?php /* @escapeNotVerified */ echo $block->getBreakpoints(); ?>
  96. }
  97. }
  98. }
  99. </script>
Add Comment
Please, Sign In to add comment