This repository was archived by the owner on Sep 15, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 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 {
Original file line number Diff line number Diff line change 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
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
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 }
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
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 {
692717
693718 return passiveEvents ;
694719 }
720+ /* eslint-enable getter-return */
695721
696722 function preloadNext ( index ) {
697723 if ( index - currentIndex >= options . preload ) {
You can’t perform that action at this time.
0 commit comments