Skip to content

Commit b28ed95

Browse files
authored
Merge pull request #616 from lokesh/release-2-10-0
v2.10.0
2 parents b867938 + 6884202 commit b28ed95

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

bower.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
"description": "The original Lightbox script. Uses jQuery.",
88
"main": [
99
"./dist/js/lightbox.js",
10-
"./dist/css/lightbox.css",
11-
"./dist/images/close.png",
12-
"./dist/images/loading.gif",
13-
"./dist/images/next.png",
14-
"./dist/images/prev.png"
10+
"./dist/css/lightbox.css"
1511
],
1612
"keywords": [
1713
"lightbox",
@@ -28,6 +24,6 @@
2824
"bower_components"
2925
],
3026
"dependencies": {
31-
"jquery": "~2"
27+
"jquery": ">2"
3228
}
3329
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lightbox2",
3-
"version": "2.9.0",
3+
"version": "2.10.0",
44
"author": "Lokesh Dhakar <lokesh.dhakar@gmail.com>",
55
"description": "The original Lightbox script. Uses jQuery.",
66
"keywords": [

src/css/lightbox.css

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/* Preload images */
2-
body:after {
3-
content: url(../images/close.png) url(../images/loading.gif) url(../images/prev.png) url(../images/next.png);
4-
display: none;
5-
}
6-
7-
body.lb-disable-scrolling {
1+
html.lb-disable-scrolling {
82
overflow: hidden;
3+
/* Position fixed required for iOS. Just putting overflow: hidden; on the body is not enough. */
4+
position: fixed;
5+
height: 100vh;
6+
width: 100vw;
97
}
108

119
.lightboxOverlay {
@@ -146,11 +144,7 @@ body.lb-disable-scrolling {
146144
padding-top: 5px;
147145
*zoom: 1;
148146
width: 100%;
149-
-moz-border-radius-bottomleft: 4px;
150-
-webkit-border-bottom-left-radius: 4px;
151147
border-bottom-left-radius: 4px;
152-
-moz-border-radius-bottomright: 4px;
153-
-webkit-border-bottom-right-radius: 4px;
154148
border-bottom-right-radius: 4px;
155149
}
156150

src/js/lightbox.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
2-
* Lightbox v2.9.0
2+
* Lightbox v2.10.0
33
* by Lokesh Dhakar
44
*
55
* More info:
66
* http://lokeshdhakar.com/projects/lightbox2/
77
*
8-
* Copyright 2007, 2015 Lokesh Dhakar
8+
* Copyright 2007, 2018 Lokesh Dhakar
99
* Released under the MIT license
1010
* https://github.com/lokesh/lightbox2/blob/master/LICENSE
1111
*
@@ -94,6 +94,10 @@
9494
// Build html for the lightbox and the overlay.
9595
// Attach event handlers to the new DOM elements. click click click
9696
Lightbox.prototype.build = function() {
97+
if ($('#lightbox').length > 0) {
98+
return;
99+
}
100+
97101
var self = this;
98102
$('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo($('body'));
99103

@@ -208,6 +212,7 @@
208212

209213
function addToAlbum($link) {
210214
self.album.push({
215+
alt: $link.attr('data-alt'),
211216
link: $link.attr('href'),
212217
title: $link.attr('data-title') || $link.attr('title')
213218
});
@@ -251,7 +256,7 @@
251256

252257
// Disable scrolling of the page while open
253258
if (this.options.disableScrolling) {
254-
$('body').addClass('lb-disable-scrolling');
259+
$('html').addClass('lb-disable-scrolling');
255260
}
256261

257262
this.changeImage(imageNumber);
@@ -282,7 +287,10 @@
282287
var windowHeight;
283288
var windowWidth;
284289

285-
$image.attr('src', self.album[imageNumber].link);
290+
$image.attr({
291+
'alt': self.album[imageNumber].alt,
292+
'src': self.album[imageNumber].link
293+
});
286294

287295
$preloader = $(preloader);
288296

@@ -503,7 +511,7 @@
503511
visibility: 'visible'
504512
});
505513
if (this.options.disableScrolling) {
506-
$('body').removeClass('lb-disable-scrolling');
514+
$('html').removeClass('lb-disable-scrolling');
507515
}
508516
};
509517

0 commit comments

Comments
 (0)