From d0e952cf930182230c8ccf79deb5a641b331dfe9 Mon Sep 17 00:00:00 2001 From: Uladzislau Harbachou Date: Wed, 2 Dec 2015 17:28:46 +0300 Subject: [PATCH 1/4] JS-334: Layout "jumps" on refresh while gallery is loading - Fixed naming of classes for gallery spinner --- lib/web/fotorama/fotorama.js | 6 ++-- lib/web/mage/gallery/gallery.html | 2 +- lib/web/mage/gallery/gallery.less | 34 ++++++++++----------- lib/web/mage/gallery/module/_variables.less | 3 +- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/lib/web/fotorama/fotorama.js b/lib/web/fotorama/fotorama.js index df4044e41d1f2..e1bfb04138cfa 100644 --- a/lib/web/fotorama/fotorama.js +++ b/lib/web/fotorama/fotorama.js @@ -89,8 +89,8 @@ fotoramaVersion = '4.6.4'; horizontalImageClass = _fotoramaClass + '_horizontal_ratio', verticalImageClass = _fotoramaClass + '_vertical_ratio', - - spinnerShowClass = _fotoramaClass + '_spinner'; + fotoramaSpinnerClass = _fotoramaClass + '__spinner', + spinnerShowClass = fotoramaSpinnerClass + '--show'; var JQUERY_VERSION = $ && $.fn.jquery.split('.'); if (!JQUERY_VERSION @@ -1791,7 +1791,7 @@ fotoramaVersion = '4.6.4'; $videoClose = $fotorama.find(cls(videoCloseClass)), videoClose = $videoClose[0], - $spinner = $fotorama.find('.fotorama_spin'), + $spinner = $fotorama.find(cls(fotoramaSpinnerClass)), $videoPlaying, diff --git a/lib/web/mage/gallery/gallery.html b/lib/web/mage/gallery/gallery.html index 15e9b88a8a657..eda2d4053c5a6 100644 --- a/lib/web/mage/gallery/gallery.html +++ b/lib/web/mage/gallery/gallery.html @@ -20,7 +20,7 @@
-
+
diff --git a/lib/web/mage/gallery/gallery.less b/lib/web/mage/gallery/gallery.less index e21f147af0946..56782946d58ff 100644 --- a/lib/web/mage/gallery/gallery.less +++ b/lib/web/mage/gallery/gallery.less @@ -13,23 +13,6 @@ @import 'module/_focus.less'; @import 'module/_fullscreen.less'; -.fotorama_spin { - display: none; - &.fotorama_spinner { - display: block; - width: 64px; - height: 64px; - background-image: url('@{baseDir}../images/loader-1.gif'); - bottom: 0; - left: 0; - margin: auto; - position: absolute; - right: 0; - top: 0; - z-index: @z-index-1; - } -} - .fotorama__zoom-in, .fotorama__zoom-out { display: none; @@ -1003,3 +986,20 @@ } } +// Styles for spinner in gallery. +.fotorama__spinnner { + display: none; + width: @fotorama-spinner-size; + height: @fotorama-spinner-size; + background-image: url('@{baseDir}../images/loader-1.gif'); + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; + z-index: @z-index-1; + &.fotorama__spinner--show { + display: block; + } +} diff --git a/lib/web/mage/gallery/module/_variables.less b/lib/web/mage/gallery/module/_variables.less index 1366f0a340b3f..24d460bb47590 100644 --- a/lib/web/mage/gallery/module/_variables.less +++ b/lib/web/mage/gallery/module/_variables.less @@ -9,4 +9,5 @@ @size-fotorama-block: 80px; @fotorama-thumb-arrow: 30px; @fotorama-fullscreen-zoom-time: 0.3s; -@fotorama-inner-box-shadow: 3px; \ No newline at end of file +@fotorama-inner-box-shadow: 3px; +@fotorama-spinner-size: 64px; \ No newline at end of file From d833ca4ac25a263101acc4fa228a3878fe5e293a Mon Sep 17 00:00:00 2001 From: Uladzislau Harbachou Date: Fri, 4 Dec 2015 13:52:25 +0300 Subject: [PATCH 2/4] JS-334: Layout "jumps" on refresh while gallery is loading - Fixed size exactly in preview of gallery --- .../view/frontend/templates/product/view/gallery.phtml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml index d344cef700db1..9c66257dfe30d 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml @@ -20,6 +20,15 @@
+