Skip to content

Commit

Permalink
Make zooming in not be terrible with magnific
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidIQ committed Mar 9, 2020
1 parent bfbd6cf commit 86a4bdf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions styles/all/template/js/reimg.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function ReIMG(altLabels, settings) {
let imageIdentifier = '#ReIMG-Clicked img.ReIMG-Anchor',
reimgheight = '',
reimgwidth = '',
imgposition = 'fixed',
imgposition = reimg.Settings.zoomMethod === ZoomMethods.Magnific ? 'inherit' : 'fixed',
reimgleft = '0px',
reimgtop = '0px';

Expand Down Expand Up @@ -324,7 +324,10 @@ function ReIMG(altLabels, settings) {
'left': $zoomBtn.data('reimgleft')
});
} else {
if ([ZoomMethods.ColorBox, ZoomMethods.Magnific].indexOf(reimg.Settings.zoomMethod) < 0) {
if (reimg.Settings.zoomMethod === ZoomMethods.Magnific) {
reimgtop = $zoomBtn.data('reimgtop');
reimgleft = $zoomBtn.data('reimgleft');
} else if ([ZoomMethods.ColorBox, ZoomMethods.Magnific].indexOf(reimg.Settings.zoomMethod) < 0) {
//Let's make the image panel a little wider
const naturalWidth = $image[0].naturalWidth,
screenWidth = $(window).width();
Expand All @@ -348,9 +351,9 @@ function ReIMG(altLabels, settings) {
$zoomBtn.css({
'left': newLeft
});
imgposition = 'absolute';
}
$zoomImg.addClass('ReIMG-ZoomOut');
imgposition = 'absolute';
}

$image.css({
Expand Down

0 comments on commit 86a4bdf

Please sign in to comment.