Skip to content

Commit 08d4adf

Browse files
committed
Merge pull request #75 from ValeryYafremau/JS-361
JS-361: Magnifier is visible on mobile breakpoint
2 parents 14096d1 + ba7ea45 commit 08d4adf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/web/magnifier/magnifier.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,16 @@
165165
}
166166

167167
data[idx].lensH = data[idx].lensH > $thumb.height() ? $thumb.height() : data[idx].lensH;
168-
lens.css({
169-
width: data[idx].lensW + 1 + 'px',
170-
height: data[idx].lensH - 1 + 'px'
171-
});
168+
169+
if (Math.round(data[idx].lensW) === 0) {
170+
lens.css('display', 'none');
171+
} else {
172+
lens.css({
173+
width: data[idx].lensW + 1 + 'px',
174+
height: data[idx].lensH - 1 + 'px',
175+
display: ''
176+
});
177+
}
172178
}
173179

174180
function getMousePos() {

0 commit comments

Comments
 (0)