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

Commit

Permalink
Update baguetteBox to v1.11.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Dec 4, 2018
1 parent d4bb72b commit 7a0a6c5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/assets/css/vendor/baguetteBox.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* baguetteBox.js
* @author feimosi
* @version 1.10.0
* @version 1.11.0
* @url https://github.com/feimosi/baguetteBox.js
*/
#baguetteBox-overlay {
Expand Down
30 changes: 28 additions & 2 deletions source/assets/js/vendor/baguetteBox.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* baguetteBox.js
* @author feimosi
* @version 1.10.0
* @version 1.11.0
* @url https://github.com/feimosi/baguetteBox.js
*/

Expand Down Expand Up @@ -307,6 +307,12 @@
case 27: // Esc
hideOverlay();
break;
case 36: // Home
showFirstImage(event);
break;
case 35: // End
showLastImage(event);
break;
}
}

Expand Down Expand Up @@ -482,7 +488,9 @@
overlay.className = '';
setTimeout(function() {
overlay.style.display = 'none';
exitFullscreen();
if (document.fullscreen) {
exitFullscreen();
}
if (options.bodyClass && document.body.classList) {
document.body.classList.remove(options.bodyClass);
}
Expand Down Expand Up @@ -598,6 +606,22 @@
return show(currentIndex - 1);
}

// Return false at the left end of the gallery
function showFirstImage(event) {
if (event) {
event.preventDefault();
}
return show(0);
}

// Return false at the right end of the gallery
function showLastImage(event) {
if (event) {
event.preventDefault();
}
return show(currentGallery.length - 1);
}

/**
* Move the gallery to a specific index
* @param `index` {number} - the position of the image
Expand Down Expand Up @@ -679,6 +703,7 @@
}

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

return passiveEvents;
}
/* eslint-enable getter-return */

function preloadNext(index) {
if (index - currentIndex >= options.preload) {
Expand Down

0 comments on commit 7a0a6c5

Please sign in to comment.