Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 2d1e511

Browse files
committed
Fix #1905
1 parent c7a249e commit 2d1e511

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

dist/jquery.fancybox.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==================================================
2-
// fancyBox v3.3.1
2+
// fancyBox v3.3.2
33
//
44
// Licensed GPLv3 for open source use
55
// or fancyBox Commercial License for commercial use
@@ -1678,7 +1678,7 @@
16781678
if (slide.isLoading && (!$img || !$img[0].complete) && !slide.hasError) {
16791679
self.showLoading(slide);
16801680
}
1681-
}, 300);
1681+
}, 350);
16821682

16831683
// If we have "srcset", then we need to find first matching "src" value.
16841684
// This is necessary, because when you set an src attribute, the browser will preload the image
@@ -1769,6 +1769,7 @@
17691769
.attr("src", thumbSrc);
17701770
}
17711771

1772+
// Start loading actual image
17721773
self.setBigImage(slide);
17731774
},
17741775

@@ -2181,6 +2182,7 @@
21812182

21822183
duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10);
21832184

2185+
// Do not animate if revealing the same slide
21842186
if (slide.pos === self.currPos) {
21852187
if (slide.isComplete) {
21862188
effect = false;
@@ -2204,7 +2206,6 @@
22042206

22052207
// Zoom animation
22062208
// ==============
2207-
22082209
if (effect === "zoom") {
22092210
end.scaleX = end.width / start.width;
22102211
end.scaleY = end.height / start.height;
@@ -2289,7 +2290,7 @@
22892290
var self = this,
22902291
rez = false,
22912292
$thumb = slide.opts.$thumb,
2292-
thumbPos = $thumb ? $thumb.offset() : 0,
2293+
thumbPos = $thumb && $thumb.length && $thumb[0].ownerDocument === document ? $thumb.offset() : 0,
22932294
slidePos;
22942295

22952296
// Check if element is inside the viewport by at least 1 pixel
@@ -2323,7 +2324,7 @@
23232324
);
23242325
};
23252326

2326-
if (thumbPos && $thumb[0].ownerDocument === document && isElementVisible($thumb)) {
2327+
if (thumbPos && isElementVisible($thumb)) {
23272328
slidePos = self.$refs.stage.offset();
23282329

23292330
rez = {
@@ -2764,7 +2765,7 @@
27642765
});
27652766

27662767
$.fancybox = {
2767-
version: "3.3.1",
2768+
version: "3.3.2",
27682769
defaults: defaults,
27692770

27702771
// Get current instance and execute a command.

dist/jquery.fancybox.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@fancyapps/fancybox",
33
"description": "Touch enabled, responsive and fully customizable jQuery lightbox script",
4-
"version": "3.3.1",
4+
"version": "3.3.2",
55
"homepage": "http://fancyapps.com/fancybox/",
66
"main": "./dist/jquery.fancybox.js",
77
"author": "fancyApps",

src/js/core.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@
16681668
if (slide.isLoading && (!$img || !$img[0].complete) && !slide.hasError) {
16691669
self.showLoading(slide);
16701670
}
1671-
}, 300);
1671+
}, 350);
16721672

16731673
// If we have "srcset", then we need to find first matching "src" value.
16741674
// This is necessary, because when you set an src attribute, the browser will preload the image
@@ -1759,6 +1759,7 @@
17591759
.attr("src", thumbSrc);
17601760
}
17611761

1762+
// Start loading actual image
17621763
self.setBigImage(slide);
17631764
},
17641765

@@ -2171,6 +2172,7 @@
21712172

21722173
duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10);
21732174

2175+
// Do not animate if revealing the same slide
21742176
if (slide.pos === self.currPos) {
21752177
if (slide.isComplete) {
21762178
effect = false;
@@ -2194,7 +2196,6 @@
21942196

21952197
// Zoom animation
21962198
// ==============
2197-
21982199
if (effect === "zoom") {
21992200
end.scaleX = end.width / start.width;
22002201
end.scaleY = end.height / start.height;
@@ -2279,7 +2280,7 @@
22792280
var self = this,
22802281
rez = false,
22812282
$thumb = slide.opts.$thumb,
2282-
thumbPos = $thumb ? $thumb.offset() : 0,
2283+
thumbPos = $thumb && $thumb.length && $thumb[0].ownerDocument === document ? $thumb.offset() : 0,
22832284
slidePos;
22842285

22852286
// Check if element is inside the viewport by at least 1 pixel
@@ -2313,7 +2314,7 @@
23132314
);
23142315
};
23152316

2316-
if (thumbPos && $thumb[0].ownerDocument === document && isElementVisible($thumb)) {
2317+
if (thumbPos && isElementVisible($thumb)) {
23172318
slidePos = self.$refs.stage.offset();
23182319

23192320
rez = {

0 commit comments

Comments
 (0)