Skip to content

Commit

Permalink
Fixed #191 (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic authored and rejas committed Mar 28, 2019
1 parent 9282377 commit 13a6bbc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/imagelightbox.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/imagelightbox.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/javascripts/imagelightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,13 @@
});
},
captionReset = function () {
$captionObject.css('opacity', '0');
$captionObject.html(' ');
if ($(target).data('ilb2-caption')) {
$captionObject.css('opacity', '1');
$captionObject.html($(target).data('ilb2-caption'));
} else if ($(target).find('img').length > 0) {
} else if ($(target).find('img').attr('alt')) {
$captionObject.css('opacity', '1');
$captionObject.html($(target).find('img').attr('alt'));
}
},
Expand Down
1 change: 1 addition & 0 deletions docs/stylesheets/imagelightbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
right: 0;
bottom: 0;
padding: 0.625em; /* 10 */
transition: opacity .25s ease;
}

/* WITH NAVIGATION */
Expand Down
1 change: 1 addition & 0 deletions src/imagelightbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
right: 0;
bottom: 0;
padding: 0.625em; /* 10 */
transition: opacity .25s ease;
}

/* WITH NAVIGATION */
Expand Down
5 changes: 4 additions & 1 deletion src/imagelightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,13 @@
});
},
captionReset = function () {
$captionObject.css('opacity', '0');
$captionObject.html(' ');
if ($(target).data('ilb2-caption')) {
$captionObject.css('opacity', '1');
$captionObject.html($(target).data('ilb2-caption'));
} else if ($(target).find('img').length > 0) {
} else if ($(target).find('img').attr('alt')) {
$captionObject.css('opacity', '1');
$captionObject.html($(target).find('img').attr('alt'));
}
},
Expand Down

0 comments on commit 13a6bbc

Please sign in to comment.