Skip to content

Commit f4bdb5d

Browse files
committed
JS-255: Stabilization fixes for magnifier and gallery
1 parent eacba1c commit f4bdb5d

File tree

4 files changed

+548
-435
lines changed

4 files changed

+548
-435
lines changed

lib/web/mage/gallery/gallery.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="fotorama-item" data-gallery-role="gallery" tabindex="0">
88
<div data-gallery-role="fotorama__focusable-start" tabindex="0"></div>
99
<div class="fotorama__wrap fotorama__wrap--css3 fotorama__wrap--slide fotorama__wrap--toggle-arrows">
10-
<div class="fotorama__stage">
10+
<div class="fotorama__stage" data-fotorama-stage="fotorama__stage">
1111
<div class="fotorama__arr fotorama__arr--prev" tabindex="0" role="button" aria-label="Previos">
1212
<div class="fotorama__arr__arr" data-gallery-role="arrow"></div>
1313
</div>
@@ -18,24 +18,24 @@
1818
<div class="fotorama__arr__arr" data-gallery-role="arrow"></div>
1919
</div>
2020
<div class="fotorama__video-close"></div>
21-
<div class="fotorama__zoom-in"></div>
22-
<div class="fotorama__zoom-out"></div>
21+
<div class="fotorama__zoom-in" data-gallery-role="fotorama__zoom-in" aria-label="Zoom in" role="button" tabindex="0"></div>
22+
<div class="fotorama__zoom-out" data-gallery-role="fotorama__zoom-out" aria-label="Zoom out" role="button" tabindex="0"></div>
2323
</div>
2424
<div class="fotorama__nav-wrap" data-gallery-role="nav-wrap">
2525
<div class="fotorama__nav fotorama__nav--thumbs">
26-
<div class="fotorama__fullscreen-icon" data-gallery-role="fotorama__fullscreen-icon" tabindex="0" role="button"></div>
27-
<div class="fotorama__thumb__arr--left" tabindex="0" role="button" aria-label="<%= previous %>">
26+
<div class="fotorama__fullscreen-icon" data-gallery-role="fotorama__fullscreen-icon" tabindex="0" aria-label="Exit fullscreen" role="button"></div>
27+
<div class="fotorama__thumb__arr--left" tabindex="0" role="button" aria-label="Previos">
2828
<div class="fotorama__thumb__arr" data-gallery-role="arrow"></div>
2929
</div>
3030
<div class="fotorama__nav__shaft">
3131
<div class="fotorama__thumb-border"></div>
3232
</div>
33-
<div class="fotorama__thumb__arr--right" tabindex="0" role="button" aria-label="<%= next %>">
33+
<div class="fotorama__thumb__arr--right" tabindex="0" role="button" aria-label="Next">
3434
<div class="fotorama__thumb__arr" data-gallery-role="arrow"></div>
3535
</div>
3636
</div>
3737
</div>
3838
</div>
3939
<div data-gallery-role="fotorama__focusable-end" tabindex="0"></div>
4040
</div>
41-
<div class="magnifier-preview" data-gallery-role="magnifier" id="preview"></div>
41+
<div class="magnifier-preview" data-gallery-role="magnifier" id="preview"></div>

lib/web/mage/gallery/gallery.less

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@fotorama_close_size: 30px;
99
@size-fotorama-block: 50px;
1010
@fotorama-thumb-arrow: 30px;
11+
@fotorama-fullscreen-zoom-time: 0.3s;
1112

1213
@import '../../css/source/lib/_lib.less'; // Global lib
1314
@import '../../css/source/_theme.less'; // Theme overrides
@@ -78,21 +79,30 @@
7879
&:extend(.fotorama-sprite);
7980
background-position: 0 (-@size-fotorama-block) !important;
8081
}
81-
8282
.fotorama__zoom-in {
8383
top: 0;
8484
&:extend(.fotorama-sprite);
8585
background-position: 0 0 !important;
8686
}
8787
}
8888

89+
.circle {
90+
position: absolute;
91+
background-color: silver;
92+
opacity: 0.7;
93+
border-radius: 100%;
94+
height: 1px;
95+
width: 1px;
96+
}
97+
8998
.fotorama__zoom-in,
9099
.fotorama__zoom-out {
91100
display: none;
92101
}
93102
.fotorama__fullscreen {
94103
.fotorama__zoom-in,
95104
.fotorama__zoom-out {
105+
overflow: hidden;
96106
position: absolute;
97107
width: 50px;
98108
height: 50px;
@@ -725,8 +735,13 @@
725735
display: none;
726736
}
727737

738+
.fotorama--fullscreen-icons {
739+
.fotorama__fullscreen-icon {
740+
display: none;
741+
}
742+
}
743+
728744
.fotorama__fullscreen-icon {
729-
//display: none;
730745
&:focus {
731746
&:extend(.fotorama-focus);
732747
border-radius: 50%;
@@ -736,7 +751,7 @@
736751

737752
.fotorama--fullscreen {
738753
.fotorama__fullscreen-icon {
739-
//display: inline-block;
754+
display: inline-block;
740755
background-position: (-@size-fotorama-block) 0;
741756
}
742757
}
@@ -1083,6 +1098,8 @@
10831098
max-height: 100%;
10841099
max-width: 100%;
10851100
vertical-align: middle;
1101+
transition-duration: @fotorama-fullscreen-zoom-time;
1102+
transition-property: width, height, top, left;
10861103
}
10871104
}
10881105

@@ -1235,9 +1252,7 @@ body.fotorama__fullscreen {
12351252
.magnify-fullimage {
12361253
display: inline-block;
12371254
}
1238-
.fotorama__stage__shaft {
1239-
//.fotorama__img {
1240-
// display: none;
1241-
//}
1255+
.magnify-lens {
1256+
display: none !important;
12421257
}
12431258
}

0 commit comments

Comments
 (0)