Skip to content

Commit c0cc4b7

Browse files
committed
Allow data-title attribute for setting caption.
1 parent cc30257 commit c0cc4b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/lightbox.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
a = _ref[i];
145145
this.album.push({
146146
link: $(a).attr('href'),
147-
title: $(a).attr('title')
147+
title: $(a).attr('data-title') || $(a).attr('title')
148148
});
149149
if ($(a).attr('href') === $link.attr('href')) {
150150
imageNumber = i;
@@ -155,7 +155,7 @@
155155
// If image is not part of a set
156156
this.album.push({
157157
link: $link.attr('href'),
158-
title: $link.attr('title')
158+
title: $(a).attr('data-title') || $(a).attr('title')
159159
});
160160
} else {
161161
// If image is part of a set
@@ -164,7 +164,7 @@
164164
a = _ref1[i];
165165
this.album.push({
166166
link: $(a).attr('href'),
167-
title: $(a).attr('title')
167+
title: $(a).attr('data-title') || $(a).attr('title')
168168
});
169169
if ($(a).attr('href') === $link.attr('href')) {
170170
imageNumber = i;

0 commit comments

Comments
 (0)