Skip to content

Commit eb6f00f

Browse files
JS-193: Test on Windows (IE)
1 parent 53f7c51 commit eb6f00f

File tree

6 files changed

+34
-18
lines changed

6 files changed

+34
-18
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"carouselNavigation": <?php echo $block->getVar("gallery:navigation:carousel"); ?>
4747
},
4848
"fullscreen": {
49-
"nav": "<?php echo $block->getVar("gallery:fullscreen:navigation"); ?>",
49+
"nav": "<?php echo $block->getVar("gallery:fullscreen:nav"); ?>",
5050
"loop": <?php echo $block->getVar("gallery:fullscreen:loop"); ?>,
5151
"navdir": "<?php echo $block->getVar("gallery:fullscreen:navdir"); ?>",
5252
"arrows": <?php echo $block->getVar("gallery:fullscreen:arrows"); ?>,

app/design/frontend/Magento/blank/etc/view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
<var name="gallery:transition:duration">500</var> <!-- Sets transition duration in ms -->
192192
<var name="gallery:navigation:carousel">true</var> <!-- Display navigation thumbs as carousel (true/false) -->
193193

194-
<var name="gallery:fullscreen:navigation">thumbs</var> <!-- Fullscreen navigation style (false/thumbs/dots) -->
194+
<var name="gallery:fullscreen:nav">thumbs</var> <!-- Fullscreen navigation style (false/thumbs/dots) -->
195195
<var name="gallery:fullscreen:loop">false</var> <!-- Fullscreen navigation loop (true/false) -->
196196
<var name="gallery:fullscreen:keyboard">true</var> <!-- Turn on/off keyboard arrows navigation (true/false/null) -->
197197
<var name="gallery:fullscreen:arrows">null</var> <!-- Turn on/off arrows on the sides preview (true/false/null) -->

app/design/frontend/Magento/luma/etc/view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
<var name="gallery:transition:duration">500</var> <!-- Sets transition duration in ms -->
196196
<var name="gallery:navigation:carousel">true</var> <!-- Display navigation thumbs as carousel (true/false) -->
197197

198-
<var name="gallery:fullscreen:navigation">thumbs</var> <!-- Fullscreen navigation style (false/thumbs/dots) -->
198+
<var name="gallery:fullscreen:nav">thumbs</var> <!-- Fullscreen navigation style (false/thumbs/dots) -->
199199
<var name="gallery:fullscreen:loop">true</var> <!-- Fullscreen navigation loop (true/false/null) -->
200200
<var name="gallery:fullscreen:keyboard">true</var> <!-- Turn on/off keyboard arrows navigation (true/false/null) -->
201201
<var name="gallery:fullscreen:arrows">false</var> <!-- Turn on/off arrows on the sides preview (true/false/null) -->

lib/web/fotorama/fotorama.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ fotoramaVersion = '4.6.4';
16141614
if (!options.thumb || !options.thumb.areSlides) {
16151615
$el.css($.extend(getDuration(options.time), translate));
16161616
} else {
1617-
if ($el.selector !== '.fotorama__nav-wrap .fotorama__nav .fotorama__nav__shaft') {
1617+
if ($el.selector !== "." + navWrapClass + " ." + navClass + " ." + navShaftClass) {
16181618
$el.css($.extend(getDuration(options.time), translate));
16191619

16201620
if ($el.selector === "." + thumbBorderClass) {
@@ -1624,6 +1624,14 @@ fotoramaVersion = '4.6.4';
16241624
slidePosition;
16251625

16261626
borderStep += options.navdir === 'vertical' ? options.thumb.height : options.thumb.width;
1627+
1628+
if (options.navdir === 'vertical') {
1629+
$("." + navClass).height(slideLength * borderStep + 2);
1630+
$("." + navClass).width(borderStep + 2);
1631+
} else {
1632+
$("." + navClass).width(slideLength * borderStep + 1);
1633+
$("." + navClass).height(borderStep + 2);
1634+
}
16271635

16281636
if (((borderPos < options.pos) || (options.pos === 0)) && ((borderPos !== 0) || (options.pos <= borderStep))) {
16291637

@@ -3752,35 +3760,29 @@ fotoramaVersion = '4.6.4';
37523760
console.log('>>')
37533761
if (pos < navShaftTouchTail.min) {
37543762
slidePosition = newPos + (-Math.ceil(newPos % (borderStep * slidesNumb)));
3755-
shiftSlide(slidePosition, options, borderStep, slidesNumb);
37563763
} else {
37573764
slidePosition = newPos - (borderStep * slidesNumb + Math.round(newPos % (borderStep * slidesNumb) - 1));
3758-
shiftSlide(slidePosition, options, borderStep, slidesNumb);
37593765
}
37603766
} else {
37613767
console.log('<<')
37623768
if (pos < navShaftTouchTail.min) {
37633769
if(cooDiff < 0) {
37643770
slidePosition = newPos + (-Math.ceil(newPos % (borderStep * slidesNumb)));
3765-
shiftSlide(slidePosition, options, borderStep, slidesNumb);
37663771
} else {
37673772
slidePosition = newPos - (borderStep * slidesNumb + Math.round(newPos % (borderStep * slidesNumb)- 1));
3768-
shiftSlide(slidePosition, options, borderStep, slidesNumb);
37693773
}
3770-
37713774
} else {
37723775
slidePosition = newPos + (-Math.ceil(newPos % (borderStep * slidesNumb)));
3773-
shiftSlide(slidePosition, options, borderStep, slidesNumb);
37743776
}
37753777
}
37763778
}
37773779

37783780
if (newPos === 0) {
37793781
console.log('dont move')
37803782
slidePosition = borderStep * ((newPos/ borderStep + 1) % slidesNumb - 1) - newPos;
3781-
shiftSlide(slidePosition, options, borderStep, slidesNumb);
37823783
}
37833784
}
3785+
shiftSlide(slidePosition, options, borderStep, slidesNumb);
37843786
slideDrag.slidePosition = slidePosition;
37853787
}
37863788

lib/web/mage/gallery/gallery.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
height: 50px;
7575
display: block;
7676
margin-left: 20px;
77+
z-index:1000;
7778
}
7879
.fotorama__zoom-out {
7980
top: 51px;

lib/web/magnifier/magnifier.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@
602602
});
603603
}
604604

605-
$image.on(isTouchEnabled ? 'touchstart' : 'pointerdown mousedown MSPointerDow', function (e) {
605+
$image.on(isTouchEnabled ? 'touchstart' : 'pointerdown mousedown MSPointerDown', function (e) {
606606
if (gallery.data('fotorama').fullScreen) {
607607
e.preventDefault();
608608

@@ -773,8 +773,11 @@
773773
var $image = $('[data-gallery-role="stage-shaft"] [data-active="true"] img'),
774774
gallery = $('[data-gallery-role="gallery"]'),
775775
imgOriginalSize = getImageSize($image[0].src),
776-
setedResult = Math.round($image.width() + 10);
777-
e.preventDefault();
776+
setedResult = Math.round($image.width() + options.inc);
777+
if(e) {
778+
e.preventDefault();
779+
}
780+
778781

779782
if (setedResult >imgOriginalSize.rw) {
780783
setedResult = imgOriginalSize.rw;
@@ -787,14 +790,18 @@
787790
var $image = $('[data-gallery-role="stage-shaft"] [data-active="true"] img'),
788791
gallery = $('[data-gallery-role="gallery"]'),
789792
imgOriginalSize = getImageSize($image[0].src),
790-
setedResult = Math.round($image.width() - 10);
791-
if(e) {
793+
setedResult = Math.round($image.width() - options.inc);
794+
if (e) {
792795
e.preventDefault();
793796
}
794797

795-
if (setedResult < imgOriginalSize.rw/2) {
796-
setedResult = imgOriginalSize.rw/2;
798+
if ($image.width() > $image.height() && $image.width() <= $image.parent().width()) {
799+
return
797800
}
801+
if ($image.width() <= $image.height() && $image.height() <= $image.parent().height()) {
802+
return
803+
}
804+
798805
$image.css({'width': setedResult, height: 'auto'});
799806
checkFullscreenImagePosition();
800807
}
@@ -824,6 +831,12 @@
824831
$('.fotorama__zoom-out')
825832
.off('click', zoomOut)
826833
.on('click', zoomOut);
834+
$('.fotorama__zoom-in')
835+
.off('touchstart', zoomIn)
836+
.on('touchstart', zoomIn);
837+
$('.fotorama__zoom-out')
838+
.off('touchstart', zoomOut)
839+
.on('touchstart', zoomOut);
827840
}
828841

829842
$(document).on('mousemove', onMousemove);

0 commit comments

Comments
 (0)