Skip to content
This repository was archived by the owner on Sep 15, 2020. It is now read-only.

Commit 7a0a6c5

Browse files
committed
Update baguetteBox to v1.11.0.
1 parent d4bb72b commit 7a0a6c5

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

source/assets/css/vendor/baguetteBox.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* baguetteBox.js
33
* @author feimosi
4-
* @version 1.10.0
4+
* @version 1.11.0
55
* @url https://github.com/feimosi/baguetteBox.js
66
*/
77
#baguetteBox-overlay {

source/assets/js/vendor/baguetteBox.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* baguetteBox.js
33
* @author feimosi
4-
* @version 1.10.0
4+
* @version 1.11.0
55
* @url https://github.com/feimosi/baguetteBox.js
66
*/
77

@@ -307,6 +307,12 @@
307307
case 27: // Esc
308308
hideOverlay();
309309
break;
310+
case 36: // Home
311+
showFirstImage(event);
312+
break;
313+
case 35: // End
314+
showLastImage(event);
315+
break;
310316
}
311317
}
312318

@@ -482,7 +488,9 @@
482488
overlay.className = '';
483489
setTimeout(function() {
484490
overlay.style.display = 'none';
485-
exitFullscreen();
491+
if (document.fullscreen) {
492+
exitFullscreen();
493+
}
486494
if (options.bodyClass && document.body.classList) {
487495
document.body.classList.remove(options.bodyClass);
488496
}
@@ -598,6 +606,22 @@
598606
return show(currentIndex - 1);
599607
}
600608

609+
// Return false at the left end of the gallery
610+
function showFirstImage(event) {
611+
if (event) {
612+
event.preventDefault();
613+
}
614+
return show(0);
615+
}
616+
617+
// Return false at the right end of the gallery
618+
function showLastImage(event) {
619+
if (event) {
620+
event.preventDefault();
621+
}
622+
return show(currentGallery.length - 1);
623+
}
624+
601625
/**
602626
* Move the gallery to a specific index
603627
* @param `index` {number} - the position of the image
@@ -679,6 +703,7 @@
679703
}
680704

681705
// Borrowed from https://github.com/seiyria/bootstrap-slider/pull/680/files
706+
/* eslint-disable getter-return */
682707
function testPassiveEventsSupport() {
683708
var passiveEvents = false;
684709
try {
@@ -692,6 +717,7 @@
692717

693718
return passiveEvents;
694719
}
720+
/* eslint-enable getter-return */
695721

696722
function preloadNext(index) {
697723
if (index - currentIndex >= options.preload) {

0 commit comments

Comments
 (0)