Skip to content

Commit

Permalink
Bugfix for #38 and small other fix for loop false option
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 12, 2016
1 parent d37c983 commit 6d3e7ed
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ var lightbox2 = $('.lighbox-2 a').simpleLightbox();
```

### Changelog
**1.8.3 - Bugfix for #38 and small other fix for loop false option**
**1.8.2 - Better bugfix for #33, finally fixing multiple lightbox on one page slowness issues!**
**1.8.1 - Bugfix for #31, #32 and #33**
**1.8.0 - New API Events (changed open to show) and little fix in function open() brought by Geoffrey Crofte and some other small bugfixes**
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplelightbox",
"version": "1.8.2",
"version": "1.8.3",
"homepage": "http://andreknieriem.de/simple-lightbox",
"authors": [
"André Rinas <[email protected]> (http://andreknieriem.de)"
Expand Down
10 changes: 8 additions & 2 deletions dist/simple-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ $.fn.simpleLightbox = function( options )
if(!options.loop) {
if(index == 0){ $('.sl-prev').hide();}
if(index >= objects.length -1) {$('.sl-next').hide();}
if(index > 0 && index < objects.length -1){ $('.sl-prev, .sl-next').show(); }
if(index > 0){ $('.sl-prev').show(); }
if(index < objects.length -1){ $('.sl-next').show(); }
}

if(objects.length == 1) $('.sl-prev, .sl-next').hide();
Expand Down Expand Up @@ -284,7 +285,12 @@ $.fn.simpleLightbox = function( options )
{
if(mousedown){
mousedown = false;
if( Math.abs( swipeDiff ) > options.swipeTolerance ) {
var possibleDir = true;
if(!options.loop) {
if(index == 0 && swipeDiff < 0){ possibleDir = false; }
if(index >= objects.length -1 && swipeDiff > 0) { possibleDir = false; }
}
if( Math.abs( swipeDiff ) > options.swipeTolerance && possibleDir ) {
loadImage( swipeDiff > 0 ? 1 : -1 );
}
else if( options.animationSlide )
Expand Down
2 changes: 1 addition & 1 deletion dist/simple-lightbox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplelightbox",
"version": "1.8.2",
"version": "1.8.3",
"description": "Touch-friendly image lightbox for mobile and desktop with jQuery",
"main": "dist/simple-lightbox.js",
"repository": {
Expand Down

0 comments on commit 6d3e7ed

Please sign in to comment.