Skip to content

Commit

Permalink
Fixing #292. Error with download-link
Browse files Browse the repository at this point in the history
  • Loading branch information
ars committed Jan 12, 2023
1 parent 3e493c1 commit d9c2dd4
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 40 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,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.12.1 - Fixing #292. Error with download-link**
**2.12.0 - Merging #283. Fixing className whitespace error. Thanks to @MVogge. Merging #287, which fixes #286 thanks to @majid-1xinternet. Added download option. Thanks to @cnotin**
**2.11.0 - Added possibility to add multiple classes to captions #280, added possibility for better selectors which fixes #62 again, fixed #268 lightbox not centered with scrolling**
**2.10.4 - Fixed #277 - add passive listener for scroll events, #276 mistake z-index**
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": "2.11.0",
"version": "2.12.1",
"homepage": "https://simplelightbox.com/",
"authors": [
"André Rinas <info@andrerinas.de> (https://www.andrerinas.de)"
Expand Down
7 changes: 4 additions & 3 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.12.0" />
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.12.1" />
<link rel="stylesheet" href="demo.css" />
<title>SimpleLightbox by André Rinas</title>
</head>
Expand All @@ -14,7 +14,7 @@
<div class="header-container">
<div class="container demo-container">
<div class="info">
<h1>SimpleLightbox <sup>v2.12.0</sup></h1>
<h1>SimpleLightbox <sup>v2.12.1</sup></h1>
<span class="subline">Touch-friendly image lightbox</span>
<nav>
<a class="btn donate" target="_blank" href="https://www.paypal.me/anrinas">Donate</a>
Expand Down Expand Up @@ -648,6 +648,7 @@ <h2>Customization</h2>
<h2>Changelog</h2>
</div>
<div class="col-right">
<strong>2.12.1</strong> - Fixing #292. Error with download-link<br />
<strong>2.12.0</strong> - Merging #283. Fixing className whitespace error. Thanks to @MVogge. Merging #287, which fixes #286 thanks to @majid-1xinternet. Added download option. Thanks to @cnotin<br />
<strong>2.11.0</strong> - Added possibility to add multiple classes to captions #280, added possibility for better selectors which fixes #62 again, fixed #268 lightbox not centered with scrolling<br />
<strong>2.10.4</strong> - Fixed #277 - add passive listener for scroll events, #276 mistake z-index<br />
Expand Down Expand Up @@ -767,7 +768,7 @@ <h2>Author/<br />Contributors</h2>
</div>
</footer>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="../dist/simple-lightbox.js?v2.12.0"></script>
<script src="../dist/simple-lightbox.js?v2.12.1"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
Expand Down
2 changes: 1 addition & 1 deletion dist/simple-lightbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.12.0
Version 2.12.1
*/
body.hidden-scroll {
overflow: hidden; }
Expand Down
16 changes: 11 additions & 5 deletions dist/simple-lightbox.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.12.0
Version 2.12.1
*/
class SimpleLightbox {

Expand Down Expand Up @@ -1402,8 +1402,10 @@ class SimpleLightbox {
fadeIn(elements, duration, callback, display) {
elements = this.wrap(elements);
for (let element of elements) {
element.style.opacity = 0;
element.style.display = display || "block";
if(element) {
element.style.opacity = 0;
element.style.display = display || "block";
}
}

this.isFadeIn = true;
Expand All @@ -1414,13 +1416,17 @@ class SimpleLightbox {
let currentOpacity = parseFloat(elements[0].style.opacity);
if (!((currentOpacity += step) > opacityTarget)) {
for (let element of elements) {
element.style.opacity = currentOpacity;
if(element) {
element.style.opacity = currentOpacity;
}
}
if(!this.isFadeIn) return;
requestAnimationFrame(fade);
} else {
for (let element of elements) {
element.style.opacity = opacityTarget;
if(element) {
element.style.opacity = opacityTarget;
}
}
callback && callback.call(this, elements);
}
Expand Down
16 changes: 11 additions & 5 deletions dist/simple-lightbox.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.12.0
Version 2.12.1
*/
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Expand Down Expand Up @@ -1343,8 +1343,10 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
var element = _step8.value;
element.style.opacity = 0;
element.style.display = display || "block";
if (element) {
element.style.opacity = 0;
element.style.display = display || "block";
}
}
} catch (err) {
_iterator8.e(err);
Expand All @@ -1362,7 +1364,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
var element = _step9.value;
element.style.opacity = currentOpacity;
if (element) {
element.style.opacity = currentOpacity;
}
}
} catch (err) {
_iterator9.e(err);
Expand All @@ -1377,7 +1381,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
var _element2 = _step10.value;
_element2.style.opacity = opacityTarget;
if (_element2) {
_element2.style.opacity = opacityTarget;
}
}
} catch (err) {
_iterator10.e(err);
Expand Down
2 changes: 1 addition & 1 deletion dist/simple-lightbox.jquery.min.js

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions dist/simple-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.12.0
Version 2.12.1
*/
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){(function (){
Expand Down Expand Up @@ -1331,8 +1331,10 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
var element = _step8.value;
element.style.opacity = 0;
element.style.display = display || "block";
if (element) {
element.style.opacity = 0;
element.style.display = display || "block";
}
}
} catch (err) {
_iterator8.e(err);
Expand All @@ -1350,7 +1352,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
var element = _step9.value;
element.style.opacity = currentOpacity;
if (element) {
element.style.opacity = currentOpacity;
}
}
} catch (err) {
_iterator9.e(err);
Expand All @@ -1365,7 +1369,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
var _element2 = _step10.value;
_element2.style.opacity = opacityTarget;
if (_element2) {
_element2.style.opacity = opacityTarget;
}
}
} catch (err) {
_iterator10.e(err);
Expand Down
16 changes: 11 additions & 5 deletions dist/simple-lightbox.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.12.0
Version 2.12.1
*/
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
var isCallable = require('../internals/is-callable');
Expand Down Expand Up @@ -6421,8 +6421,10 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
var element = _step8.value;
element.style.opacity = 0;
element.style.display = display || "block";
if (element) {
element.style.opacity = 0;
element.style.display = display || "block";
}
}
} catch (err) {
_iterator8.e(err);
Expand All @@ -6440,7 +6442,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
var element = _step9.value;
element.style.opacity = currentOpacity;
if (element) {
element.style.opacity = currentOpacity;
}
}
} catch (err) {
_iterator9.e(err);
Expand All @@ -6455,7 +6459,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
var _element2 = _step10.value;
_element2.style.opacity = opacityTarget;
if (_element2) {
_element2.style.opacity = opacityTarget;
}
}
} catch (err) {
_iterator10.e(err);
Expand Down
2 changes: 1 addition & 1 deletion dist/simple-lightbox.legacy.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/simple-lightbox.min.css

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

2 changes: 1 addition & 1 deletion dist/simple-lightbox.min.js

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions dist/simple-lightbox.modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.12.0
Version 2.12.1
*/
"use strict";

Expand Down Expand Up @@ -1329,8 +1329,10 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
var element = _step8.value;
element.style.opacity = 0;
element.style.display = display || "block";
if (element) {
element.style.opacity = 0;
element.style.display = display || "block";
}
}
} catch (err) {
_iterator8.e(err);
Expand All @@ -1348,7 +1350,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
var element = _step9.value;
element.style.opacity = currentOpacity;
if (element) {
element.style.opacity = currentOpacity;
}
}
} catch (err) {
_iterator9.e(err);
Expand All @@ -1363,7 +1367,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
try {
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
var _element2 = _step10.value;
_element2.style.opacity = opacityTarget;
if (_element2) {
_element2.style.opacity = opacityTarget;
}
}
} catch (err) {
_iterator10.e(err);
Expand Down
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": "2.12.0",
"version": "2.12.1",
"description": "Touch-friendly modern image lightbox for mobile and desktop with optional jQuery support",
"main": "dist/simple-lightbox.js",
"style": "dist/simple-lightbox.css",
Expand Down
2 changes: 1 addition & 1 deletion src/license-notice.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.12.0
Version 2.12.1
*/
14 changes: 10 additions & 4 deletions src/simple-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1396,8 +1396,10 @@ class SimpleLightbox {
fadeIn(elements, duration, callback, display) {
elements = this.wrap(elements);
for (let element of elements) {
element.style.opacity = 0;
element.style.display = display || "block";
if(element) {
element.style.opacity = 0;
element.style.display = display || "block";
}
}

this.isFadeIn = true;
Expand All @@ -1408,13 +1410,17 @@ class SimpleLightbox {
let currentOpacity = parseFloat(elements[0].style.opacity);
if (!((currentOpacity += step) > opacityTarget)) {
for (let element of elements) {
element.style.opacity = currentOpacity;
if(element) {
element.style.opacity = currentOpacity;
}
}
if(!this.isFadeIn) return;
requestAnimationFrame(fade);
} else {
for (let element of elements) {
element.style.opacity = opacityTarget;
if(element) {
element.style.opacity = opacityTarget;
}
}
callback && callback.call(this, elements);
}
Expand Down

0 comments on commit d9c2dd4

Please sign in to comment.