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

Commit f5e272a

Browse files
committed
Updated to v3.5.4
- Fixed #2147 - Caption overlaps bottom video-controls
1 parent 5f7dd47 commit f5e272a

File tree

9 files changed

+736
-586
lines changed

9 files changed

+736
-586
lines changed

dist/jquery.fancybox.css

Lines changed: 625 additions & 501 deletions
Large diffs are not rendered by default.

dist/jquery.fancybox.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==================================================
2-
// fancyBox v3.5.3
2+
// fancyBox v3.5.4
33
//
44
// Licensed GPLv3 for open source use
55
// or fancyBox Commercial License for commercial use
@@ -189,7 +189,7 @@
189189
'<div class="fancybox-toolbar">{{buttons}}</div>' +
190190
'<div class="fancybox-navigation">{{arrows}}</div>' +
191191
'<div class="fancybox-stage"></div>' +
192-
'<div class="fancybox-caption"></div>' +
192+
'<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' +
193193
"</div>" +
194194
"</div>",
195195

@@ -2955,7 +2955,15 @@
29552955
// Recalculate content dimensions
29562956
current.$slide.trigger("refresh");
29572957

2958-
self.$caption = caption && caption.length ? $caption.html(caption) : null;
2958+
// Set caption
2959+
if (caption && caption.length) {
2960+
self.$caption = $caption;
2961+
2962+
$caption
2963+
.children()
2964+
.eq(0)
2965+
.html(caption);
2966+
}
29592967

29602968
if (!self.hasHiddenControls && !self.isIdle) {
29612969
self.showControls();
@@ -3038,7 +3046,7 @@
30383046
});
30393047

30403048
$.fancybox = {
3041-
version: "3.5.3",
3049+
version: "3.5.4",
30423050
defaults: defaults,
30433051

30443052
// Get current instance and execute a command.
@@ -5523,7 +5531,7 @@
55235531
},
55245532

55255533
"beforeClose.fb": function(e, instance, current) {
5526-
if (current.opts.hash === false) {
5534+
if (!current || current.opts.hash === false) {
55275535
return;
55285536
}
55295537

dist/jquery.fancybox.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.fancybox.min.js

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

gulpfile.js

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,68 @@
1-
var gulp = require('gulp'),
2-
livereload = require('gulp-livereload'),
3-
concat = require('gulp-concat'),
4-
uglify = require('gulp-uglify'),
5-
rename = require('gulp-rename'),
6-
cssnano = require('gulp-cssnano'),
7-
sass = require('gulp-sass'),
8-
autoprefixer = require('gulp-autoprefixer'),
9-
header = require('gulp-header'),
10-
replace = require('gulp-replace'),
11-
gutil = require('gulp-util');
1+
var gulp = require("gulp"),
2+
concat = require("gulp-concat"),
3+
uglify = require("gulp-uglify"),
4+
rename = require("gulp-rename"),
5+
cssnano = require("gulp-cssnano"),
6+
autoprefixer = require("gulp-autoprefixer"),
7+
header = require("gulp-header"),
8+
replace = require("gulp-replace");
129

13-
var pkg = require('./package.json');
14-
var banner = ['// ==================================================',
15-
'// fancyBox v${pkg.version}',
16-
'//',
17-
'// Licensed GPLv3 for open source use',
18-
'// or fancyBox Commercial License for commercial use',
19-
'//',
20-
'// http://fancyapps.com/fancybox/',
21-
'// Copyright ${new Date().getFullYear()} fancyApps',
22-
'//',
23-
'// ==================================================',
24-
''].join('\n');
10+
var pkg = require("./package.json");
11+
var banner = [
12+
"// ==================================================",
13+
"// fancyBox v${pkg.version}",
14+
"//",
15+
"// Licensed GPLv3 for open source use",
16+
"// or fancyBox Commercial License for commercial use",
17+
"//",
18+
"// http://fancyapps.com/fancybox/",
19+
"// Copyright ${new Date().getFullYear()} fancyApps",
20+
"//",
21+
"// ==================================================",
22+
""
23+
].join("\n");
2524

2625
// Concatenate & Minify JS
2726

28-
gulp.task('scripts', function() {
29-
return gulp.src([
30-
'src/js/core.js',
31-
'src/js/media.js',
32-
'src/js/guestures.js',
33-
'src/js/slideshow.js',
34-
'src/js/fullscreen.js',
35-
'src/js/thumbs.js',
36-
'src/js/hash.js',
37-
'src/js/wheel.js'
38-
])
39-
.pipe(concat('jquery.fancybox.js'))
40-
.pipe(replace(/({fancybox-version})/g, pkg.version))
41-
.pipe(header(banner, { pkg : pkg } ))
42-
.pipe(gulp.dest('dist'))
43-
.pipe(rename({suffix: '.min'}))
44-
.pipe(uglify())
45-
.pipe(header(banner, { pkg : pkg } ))
46-
.pipe(gulp.dest('dist'));
47-
});
48-
27+
gulp.task("scripts", function() {
28+
return gulp
29+
.src([
30+
"src/js/core.js",
31+
"src/js/media.js",
32+
"src/js/guestures.js",
33+
"src/js/slideshow.js",
34+
"src/js/fullscreen.js",
35+
"src/js/thumbs.js",
36+
"src/js/hash.js",
37+
"src/js/wheel.js"
38+
])
39+
.pipe(concat("jquery.fancybox.js"))
40+
.pipe(replace(/({fancybox-version})/g, pkg.version))
41+
.pipe(header(banner, {pkg: pkg}))
42+
.pipe(gulp.dest("dist"))
43+
.pipe(rename({suffix: ".min"}))
44+
.pipe(uglify())
45+
.pipe(header(banner, {pkg: pkg}))
46+
.pipe(gulp.dest("dist"));
47+
});
4948

5049
// Compile CSS
5150

52-
gulp.task('css', function() {
53-
return gulp.src('src/css/*.css') // Gets all files src/css
54-
.pipe(sass())
55-
.pipe(autoprefixer({
56-
browsers: ['last 5 versions'],
57-
cascade: false
58-
}))
59-
.pipe(concat('jquery.fancybox.css'))
60-
.pipe(gulp.dest('dist'))
61-
.pipe(rename({suffix: '.min'}))
62-
.pipe(cssnano({zindex: false}))
63-
.pipe(gulp.dest('dist'));
51+
gulp.task("css", function() {
52+
return gulp
53+
.src("src/css/*.css") // Gets all files src/css
54+
.pipe(
55+
autoprefixer({
56+
browsers: ["last 5 versions"],
57+
cascade: false
58+
})
59+
)
60+
.pipe(concat("jquery.fancybox.css"))
61+
.pipe(gulp.dest("dist"))
62+
.pipe(rename({suffix: ".min"}))
63+
.pipe(cssnano({zindex: false}))
64+
.pipe(gulp.dest("dist"));
6465
});
6566

6667
// Default Task
67-
gulp.task('default', ['scripts', 'css']);
68+
gulp.task("default", ["scripts", "css"]);

package.json

Lines changed: 1 addition & 2 deletions
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.5.3",
4+
"version": "3.5.4",
55
"homepage": "https://fancyapps.com/fancybox/3/",
66
"main": "dist/jquery.fancybox.js",
77
"style": "dist/jquery.fancybox.css",
@@ -26,7 +26,6 @@
2626
"gulp-notify": "^2.2.0",
2727
"gulp-rename": "^1.2.2",
2828
"gulp-replace": "^0.5.4",
29-
"gulp-sass": "^3.0.0",
3029
"gulp-uglify": "^2.0.0",
3130
"gulp-util": "^3.0.8",
3231
"jshint": "^2.9.4"

src/css/core.css

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,27 @@ body.compensate-for-scrollbar {
458458
font-weight: 400;
459459
left: 0;
460460
line-height: 1.5;
461-
overflow: auto;
462-
padding: 50px 44px 25px 44px;
461+
padding: 75px 44px 25px 44px;
462+
pointer-events: none;
463463
right: 0;
464464
text-align: center;
465465
z-index: 99996;
466466
}
467467

468+
@supports (padding: max(0px)) {
469+
.fancybox-caption {
470+
padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));
471+
}
472+
}
473+
468474
.fancybox-caption--separate {
469-
margin-top: -25px;
475+
margin-top: -50px;
476+
}
477+
478+
.fancybox-caption__body {
470479
max-height: 50vh;
480+
overflow: auto;
481+
pointer-events: all;
471482
}
472483

473484
.fancybox-caption a,
@@ -609,11 +620,6 @@ body.compensate-for-scrollbar {
609620

610621
/* Styling for Small-Screen Devices */
611622
@media all and (max-height: 576px) {
612-
.fancybox-caption {
613-
padding-left: 12px;
614-
padding-right: 12px;
615-
}
616-
617623
.fancybox-slide {
618624
padding-left: 6px;
619625
padding-right: 6px;
@@ -637,12 +643,16 @@ body.compensate-for-scrollbar {
637643
top: 0;
638644
width: 36px;
639645
}
640-
}
641646

642-
/* Using calc to trick sass */
643-
@supports (padding: max(0px)) {
644647
.fancybox-caption {
645-
padding: 50px calc(max(12px, env(safe-area-inset-right))) calc(max(12px, env(safe-area-inset-bottom)))
646-
calc(max(25px, env(safe-area-inset-left)));
648+
padding-left: 12px;
649+
padding-right: 12px;
650+
}
651+
652+
@supports (padding: max(0px)) {
653+
.fancybox-caption {
654+
padding-left: max(12px, env(safe-area-inset-left));
655+
padding-right: max(12px, env(safe-area-inset-right));
656+
}
647657
}
648658
}

src/js/core.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
'<div class="fancybox-toolbar">{{buttons}}</div>' +
180180
'<div class="fancybox-navigation">{{arrows}}</div>' +
181181
'<div class="fancybox-stage"></div>' +
182-
'<div class="fancybox-caption"></div>' +
182+
'<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' +
183183
"</div>" +
184184
"</div>",
185185

@@ -2945,7 +2945,15 @@
29452945
// Recalculate content dimensions
29462946
current.$slide.trigger("refresh");
29472947

2948-
self.$caption = caption && caption.length ? $caption.html(caption) : null;
2948+
// Set caption
2949+
if (caption && caption.length) {
2950+
self.$caption = $caption;
2951+
2952+
$caption
2953+
.children()
2954+
.eq(0)
2955+
.html(caption);
2956+
}
29492957

29502958
if (!self.hasHiddenControls && !self.isIdle) {
29512959
self.showControls();

src/js/hash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
},
149149

150150
"beforeClose.fb": function(e, instance, current) {
151-
if (current.opts.hash === false) {
151+
if (!current || current.opts.hash === false) {
152152
return;
153153
}
154154

0 commit comments

Comments
 (0)