From 473b7eb25e21d5cb64637614eacfa25931e691ac Mon Sep 17 00:00:00 2001 From: Arinas Date: Thu, 29 Oct 2020 13:25:56 +0100 Subject: [PATCH] Added new option uniqueImages for #156, focus for #190 and fixed bug #200 issue closing during animation. --- README.md | 17 ++++-- bower.json | 2 +- demo/index.html | 25 +++++--- dist/simple-lightbox.css | 13 ++-- dist/simple-lightbox.esm.js | 92 +++++++++++++++++++++------- dist/simple-lightbox.jquery.js | 98 ++++++++++++++++++++++-------- dist/simple-lightbox.jquery.min.js | 2 +- dist/simple-lightbox.js | 98 ++++++++++++++++++++++-------- dist/simple-lightbox.legacy.js | 98 ++++++++++++++++++++++-------- dist/simple-lightbox.legacy.min.js | 2 +- dist/simple-lightbox.min.css | 4 +- dist/simple-lightbox.min.js | 2 +- dist/simple-lightbox.modules.js | 98 ++++++++++++++++++++++-------- package.json | 2 +- src/license-notice.txt | 2 +- src/simple-lightbox.js | 90 ++++++++++++++++++++------- src/simple-lightbox.scss | 10 ++- 17 files changed, 482 insertions(+), 173 deletions(-) diff --git a/README.md b/README.md index e57eb35..8658c92 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ For a whole example just look at the demo folder. | rtl | false | bool | change direction to rigth-to-left | | fixedClass | 'sl-fixed' | string | elements with this class are fixed and get the right padding when lightbox opens | | fadeSpeed | 300 | int | the duration for fading in and out in milliseconds. Used for caption fadein/out too. If smaller than 100 it should be used with animationSlide:false | +| uniqueImages | true | bool | whether to uniqualize images or not | ### Events | Name | Description | @@ -132,12 +133,19 @@ For a whole example just look at the demo folder. **Example** ```javascript -$('.gallery a').on('open.simplelightbox', function () { - // do something… +let gallery = new SimpleLightbox('.gallery a'); +gallery.on('show.simplelightbox', function () { + // do something… }); -$('.gallery a').on('error.simplelightbox', function (e) { - console.log(e); // some usefull information +gallery.on('error.simplelightbox', function (e) { + console.log(e); // some usefull information +}); + +// with jQuery nearly the same +let gallery = $('.gallery a').simpleLightbox(); +gallery.on('show.simplelightbox', function () { + // do something… }); ``` @@ -207,6 +215,7 @@ Run `gulp watch` to enable continous watching of both src/simple-lightbox.js and Just call `gulp build` to have all files and variants created inside dist! ### Changelog +**2.6.0 - Added new option uniqueImages for #156, focus for #190 and fixed bug #200 issue closing during animation** **2.5.0 - Added new option fadeSpeed. This will fix #147 and #186** **2.4.1 - Added new simple-lightbox.legacy.js with IE 11 Support. Fixes #175, #178, #183 and some other bugs from 2.4.0** **2.4.0 - Added new option for fixed elements class #195** diff --git a/bower.json b/bower.json index 4619e6a..15dc254 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "simplelightbox", - "version": "2.5.0", + "version": "2.6.0", "homepage": "https://simplelightbox.com/", "authors": [ "André Rinas (https://www.andrerinas.de)" diff --git a/demo/index.html b/demo/index.html index 321170a..1518c72 100644 --- a/demo/index.html +++ b/demo/index.html @@ -4,7 +4,7 @@ - + SimpleLightbox by André Rinas @@ -14,7 +14,7 @@
-

SimpleLightbox v2.5.0

+

SimpleLightbox v2.6.0

Touch-friendly image lightbox
@@ -609,6 +621,7 @@

Customization

Changelog

+ 2.6.0 - Added new option uniqueImages for #156, focus for #190 and fixed bug #200 issue closing during animation.
2.5.0 - Added new option fadeSpeed. This will fix #147.
2.4.1 - Added new simple-lightbox.legacy.js with IE 11 Support
2.4.0 - Added new option for fixed elements class #195
@@ -710,12 +723,8 @@

Author/
Contributors

Images from Unsplash · Thanks to PrismJS for syntax highlighting.
- - - + +