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

Commit

Permalink
Updated to v3.5.4
Browse files Browse the repository at this point in the history
- Fixed #2147 - Caption overlaps bottom video-controls
  • Loading branch information
fancyapps committed Dec 12, 2018
1 parent 5f7dd47 commit f5e272a
Show file tree
Hide file tree
Showing 9 changed files with 736 additions and 586 deletions.
1,126 changes: 625 additions & 501 deletions dist/jquery.fancybox.css

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions dist/jquery.fancybox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ==================================================
// fancyBox v3.5.3
// fancyBox v3.5.4
//
// Licensed GPLv3 for open source use
// or fancyBox Commercial License for commercial use
Expand Down Expand Up @@ -189,7 +189,7 @@
'<div class="fancybox-toolbar">{{buttons}}</div>' +
'<div class="fancybox-navigation">{{arrows}}</div>' +
'<div class="fancybox-stage"></div>' +
'<div class="fancybox-caption"></div>' +
'<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' +
"</div>" +
"</div>",

Expand Down Expand Up @@ -2955,7 +2955,15 @@
// Recalculate content dimensions
current.$slide.trigger("refresh");

self.$caption = caption && caption.length ? $caption.html(caption) : null;
// Set caption
if (caption && caption.length) {
self.$caption = $caption;

$caption
.children()
.eq(0)
.html(caption);
}

if (!self.hasHiddenControls && !self.isIdle) {
self.showControls();
Expand Down Expand Up @@ -3038,7 +3046,7 @@
});

$.fancybox = {
version: "3.5.3",
version: "3.5.4",
defaults: defaults,

// Get current instance and execute a command.
Expand Down Expand Up @@ -5523,7 +5531,7 @@
},

"beforeClose.fb": function(e, instance, current) {
if (current.opts.hash === false) {
if (!current || current.opts.hash === false) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.fancybox.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/jquery.fancybox.min.js

Large diffs are not rendered by default.

115 changes: 58 additions & 57 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,68 @@
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
cssnano = require('gulp-cssnano'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
header = require('gulp-header'),
replace = require('gulp-replace'),
gutil = require('gulp-util');
var gulp = require("gulp"),
concat = require("gulp-concat"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
cssnano = require("gulp-cssnano"),
autoprefixer = require("gulp-autoprefixer"),
header = require("gulp-header"),
replace = require("gulp-replace");

var pkg = require('./package.json');
var banner = ['// ==================================================',
'// fancyBox v${pkg.version}',
'//',
'// Licensed GPLv3 for open source use',
'// or fancyBox Commercial License for commercial use',
'//',
'// http://fancyapps.com/fancybox/',
'// Copyright ${new Date().getFullYear()} fancyApps',
'//',
'// ==================================================',
''].join('\n');
var pkg = require("./package.json");
var banner = [
"// ==================================================",
"// fancyBox v${pkg.version}",
"//",
"// Licensed GPLv3 for open source use",
"// or fancyBox Commercial License for commercial use",
"//",
"// http://fancyapps.com/fancybox/",
"// Copyright ${new Date().getFullYear()} fancyApps",
"//",
"// ==================================================",
""
].join("\n");

// Concatenate & Minify JS

gulp.task('scripts', function() {
return gulp.src([
'src/js/core.js',
'src/js/media.js',
'src/js/guestures.js',
'src/js/slideshow.js',
'src/js/fullscreen.js',
'src/js/thumbs.js',
'src/js/hash.js',
'src/js/wheel.js'
])
.pipe(concat('jquery.fancybox.js'))
.pipe(replace(/({fancybox-version})/g, pkg.version))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'));
});

gulp.task("scripts", function() {
return gulp
.src([
"src/js/core.js",
"src/js/media.js",
"src/js/guestures.js",
"src/js/slideshow.js",
"src/js/fullscreen.js",
"src/js/thumbs.js",
"src/js/hash.js",
"src/js/wheel.js"
])
.pipe(concat("jquery.fancybox.js"))
.pipe(replace(/({fancybox-version})/g, pkg.version))
.pipe(header(banner, {pkg: pkg}))
.pipe(gulp.dest("dist"))
.pipe(rename({suffix: ".min"}))
.pipe(uglify())
.pipe(header(banner, {pkg: pkg}))
.pipe(gulp.dest("dist"));
});

// Compile CSS

gulp.task('css', function() {
return gulp.src('src/css/*.css') // Gets all files src/css
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 5 versions'],
cascade: false
}))
.pipe(concat('jquery.fancybox.css'))
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(cssnano({zindex: false}))
.pipe(gulp.dest('dist'));
gulp.task("css", function() {
return gulp
.src("src/css/*.css") // Gets all files src/css
.pipe(
autoprefixer({
browsers: ["last 5 versions"],
cascade: false
})
)
.pipe(concat("jquery.fancybox.css"))
.pipe(gulp.dest("dist"))
.pipe(rename({suffix: ".min"}))
.pipe(cssnano({zindex: false}))
.pipe(gulp.dest("dist"));
});

// Default Task
gulp.task('default', ['scripts', 'css']);
gulp.task("default", ["scripts", "css"]);
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fancyapps/fancybox",
"description": "Touch enabled, responsive and fully customizable jQuery lightbox script",
"version": "3.5.3",
"version": "3.5.4",
"homepage": "https://fancyapps.com/fancybox/3/",
"main": "dist/jquery.fancybox.js",
"style": "dist/jquery.fancybox.css",
Expand All @@ -26,7 +26,6 @@
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-sass": "^3.0.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.8",
"jshint": "^2.9.4"
Expand Down
36 changes: 23 additions & 13 deletions src/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -458,16 +458,27 @@ body.compensate-for-scrollbar {
font-weight: 400;
left: 0;
line-height: 1.5;
overflow: auto;
padding: 50px 44px 25px 44px;
padding: 75px 44px 25px 44px;
pointer-events: none;
right: 0;
text-align: center;
z-index: 99996;
}

@supports (padding: max(0px)) {
.fancybox-caption {
padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));
}
}

.fancybox-caption--separate {
margin-top: -25px;
margin-top: -50px;
}

.fancybox-caption__body {
max-height: 50vh;
overflow: auto;
pointer-events: all;
}

.fancybox-caption a,
Expand Down Expand Up @@ -609,11 +620,6 @@ body.compensate-for-scrollbar {

/* Styling for Small-Screen Devices */
@media all and (max-height: 576px) {
.fancybox-caption {
padding-left: 12px;
padding-right: 12px;
}

.fancybox-slide {
padding-left: 6px;
padding-right: 6px;
Expand All @@ -637,12 +643,16 @@ body.compensate-for-scrollbar {
top: 0;
width: 36px;
}
}

/* Using calc to trick sass */
@supports (padding: max(0px)) {
.fancybox-caption {
padding: 50px calc(max(12px, env(safe-area-inset-right))) calc(max(12px, env(safe-area-inset-bottom)))
calc(max(25px, env(safe-area-inset-left)));
padding-left: 12px;
padding-right: 12px;
}

@supports (padding: max(0px)) {
.fancybox-caption {
padding-left: max(12px, env(safe-area-inset-left));
padding-right: max(12px, env(safe-area-inset-right));
}
}
}
12 changes: 10 additions & 2 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
'<div class="fancybox-toolbar">{{buttons}}</div>' +
'<div class="fancybox-navigation">{{arrows}}</div>' +
'<div class="fancybox-stage"></div>' +
'<div class="fancybox-caption"></div>' +
'<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' +
"</div>" +
"</div>",

Expand Down Expand Up @@ -2945,7 +2945,15 @@
// Recalculate content dimensions
current.$slide.trigger("refresh");

self.$caption = caption && caption.length ? $caption.html(caption) : null;
// Set caption
if (caption && caption.length) {
self.$caption = $caption;

$caption
.children()
.eq(0)
.html(caption);
}

if (!self.hasHiddenControls && !self.isIdle) {
self.showControls();
Expand Down
2 changes: 1 addition & 1 deletion src/js/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
},

"beforeClose.fb": function(e, instance, current) {
if (current.opts.hash === false) {
if (!current || current.opts.hash === false) {
return;
}

Expand Down

0 comments on commit f5e272a

Please sign in to comment.