Skip to content

Commit

Permalink
Merged pull request #113,#114,#115 - Thanks to RaphaelHaettich and ce…
Browse files Browse the repository at this point in the history
…lsius-jochen
  • Loading branch information
root committed Nov 27, 2018
1 parent 832025d commit 94d8d64
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 53 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ $sl-iframe-border-large: 0 none;


### Changelog
**1.15.1 - Merged pull request #113,#114,#115 - Thanks to RaphaelHaettich and celsius-jochen**
**1.15.0 - Merged pull request #111, fixed #101 and added possibility to close lightbox on load #74**
**1.14.0 - Merged pull request #107 and #108. Thanks to RaphaelHaettich**
**1.13.0 - Added featured #92 and merged pull request #98 and #99. Thanks to RaphaelHaettich**
Expand Down Expand Up @@ -213,5 +214,6 @@ $sl-iframe-border-large: 0 none;
[helloilya](https://github.com/helloilya)
[bitstarr](https://github.com/bitstarr)
[Geoffrey Crofte](http://geoffrey.crofte.fr/) - [Github](https://github.com/creativejuiz/)
[Karl Anders](http://webseiten-anders.de/) - [Github](https://github.com/karland/)
[Raphael Hättich](https://github.com/RaphaelHaettich)
[Karl Anders](http://webseiten-anders.de/) - [Github](https://github.com/karland/)
[Raphael Hättich](https://github.com/RaphaelHaettich)
[Jochen Sengier](https://www.celcius.be) - [Github](https://github.com/celcius-jochen/)
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.15.0",
"version": "1.15.1",
"homepage": "http://andreknieriem.de/simple-lightbox",
"authors": [
"André Rinas <[email protected]> (http://andrerinas.de)"
Expand Down
15 changes: 12 additions & 3 deletions dist/simple-lightbox.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
By André Rinas, www.andrerinas.de
Available for use under the MIT License
1.15.0
1.15.1
*/
;( function( $, window, document, undefined )
{
Expand Down Expand Up @@ -149,6 +149,7 @@ $.fn.simpleLightbox = function( options )
counter = $('<div>').addClass('sl-counter').html('<span class="sl-current"></span>/<span class="sl-total"></span>'),
animating = false,
index = 0,
startIndex = 0,
caption = $('<div>').addClass('sl-caption '+options.captionClass+' pos-'+options.captionPosition),
image = $('<div>').addClass('sl-image'),
wrapper = $('<div>').addClass('sl-wrapper').addClass(options.className),
Expand Down Expand Up @@ -209,10 +210,15 @@ $.fn.simpleLightbox = function( options )
animating = false;
opened = true;
spinner.hide();
var dirDefinined = (dir == 1 || dir == -1);
if(startIndex === index && dirDefinined){
close();
return;
}
if(options.alertError){
alert(options.alertErrorMessage);
}
if(dir == 1 || dir == -1){
if(dirDefinined){
loadImage(dir);
} else {
loadImage(1);
Expand Down Expand Up @@ -506,7 +512,9 @@ $.fn.simpleLightbox = function( options )
if(isValidLink(this)){
e.preventDefault();
if(animating) return false;
openImage($(this));
var elem = $(this);
startIndex = objects.index(elem);
openImage(elem);
}
});

Expand Down Expand Up @@ -554,6 +562,7 @@ $.fn.simpleLightbox = function( options )
// Public methods
this.open = function(elem){
elem = elem || $(this[0]);
startIndex = objects.index(elem);
openImage(elem);
};

Expand Down
Loading

0 comments on commit 94d8d64

Please sign in to comment.