Skip to content

Commit 329c55e

Browse files
committed
github jackwanders#33: show overlay when image has a title OR a description (caption)
1 parent 490bcec commit 329c55e

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

js/jquery.galleryview-3.0-dev.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -657,16 +657,17 @@ if (typeof Object.create !== 'function') {
657657

658658
autoShowOverlay: function(i) {
659659
if (this.opts.overlay_visible == "auto") {
660-
if (
661-
this.gvImages[i].attrs.description.replace(/^\s+|\s+$/g, '') != '' &&
662-
this.gvImages[i].attrs.title.replace(/^\s+|\s+$/g, '') != ''
663-
)
664-
this.showOverlay()
665-
else
666-
this.hideOverlay()
667-
660+
// show the overlay if either the
661+
// title or caption/description is not empty.
662+
if ( this.gvImages[i].attrs.description.trim() ||
663+
this.gvImages[i].attrs.title.trim()
664+
) {
665+
this.showOverlay();
666+
} else {
667+
this.hideOverlay();
668+
}
668669
} else if (this.opts.overlay_visible) {
669-
this.showOverlay()
670+
this.showOverlay();
670671
}
671672
},
672673

0 commit comments

Comments
 (0)