Skip to content

Commit

Permalink
Fixed #277 - add passive listener for scroll events, #276 mistake z-i…
Browse files Browse the repository at this point in the history
…ndex
  • Loading branch information
ars committed Oct 13, 2022
1 parent 00920a1 commit 30317f8
Show file tree
Hide file tree
Showing 20 changed files with 1,827 additions and 20,775 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ build
npm-debug.log
.env
.idea
.DS_Stor
.DS_Store
package-lock.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,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.10.4 - Fixed #277 - add passive listener for scroll events, #276 mistake z-index**
**2.10.3 - Fixed #264 - Fixed wrong mouse-zoom when the page is scrolled**
**2.10.2 - Fixed #258 with opacity flicker on overlay. For this, moved style option captionOpacity to js plugin**
**2.10.1 - Fixed #255 fast switching photos and #256 for hiding back and next buttons on loop: false**
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.10.3",
"version": "2.10.4",
"homepage": "https://simplelightbox.com/",
"authors": [
"André Rinas <[email protected]> (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.10.3" />
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.10.4" />
<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.10.3</sup></h1>
<h1>SimpleLightbox <sup>v2.10.4</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 @@ -642,6 +642,7 @@ <h2>Customization</h2>
<h2>Changelog</h2>
</div>
<div class="col-right">
<strong>2.10.4</strong> - Fixed #277 - add passive listener for scroll events, #276 mistake z-index<br />
<strong>2.10.3</strong> - Fixed #264 - Fixed wrong mouse-zoom when the page is scrolled<br />
<strong>2.10.2</strong> - Fixed #258 with opacity flicker on overlay. For this, moved style option captionOpacity to js plugin<br />
<strong>2.10.1</strong> - Fixed #255 fast switching photos and #256 for hiding back and next buttons on loop: false<br />
Expand Down Expand Up @@ -758,7 +759,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.10.3"></script>
<script src="../dist/simple-lightbox.js?v2.10.4"></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 demo/onlyImages.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title>Simple Lightbox - Responsive touch friendly Image lightbox</title>
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.8.0" />
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.10.4" />
<style>
body {
font-family: 'Raleway', sans-serif;
Expand Down
4 changes: 2 additions & 2 deletions 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.10.3
Version 2.10.4
*/
body.hidden-scroll {
overflow: hidden; }
Expand Down Expand Up @@ -53,7 +53,7 @@ body.hidden-scroll {
position: fixed;
top: 30px;
left: 30px;
z-index: 1060;
z-index: 10060;
color: #000;
font-size: 1rem; }
.sl-wrapper .sl-navigation {
Expand Down
5 changes: 3 additions & 2 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.10.3
Version 2.10.4
*/
class SimpleLightbox {

Expand Down Expand Up @@ -1268,14 +1268,15 @@ class SimpleLightbox {

for (let event of events) {
let options = opts || false;
let needsPassiveFix = ['touchstart', 'touchmove'].indexOf(event.split('.')[0]) >= 0;
let needsPassiveFix = ['touchstart', 'touchmove','mousewheel','DOMMouseScroll'].indexOf(event.split('.')[0]) >= 0;
if (needsPassiveFix && this.isPassiveEventsSupported) {
if (typeof options === 'object') {
options.passive = true;
} else {
options = {passive: true};
}
}

element.namespaces[event] = callback;
element.addEventListener(event.split('.')[0], callback, options);
}
Expand Down
Loading

0 comments on commit 30317f8

Please sign in to comment.