Skip to content

Commit

Permalink
github jackwanders#33: show overlay when image has a title OR a descr…
Browse files Browse the repository at this point in the history
…iption (caption)
  • Loading branch information
timburrows committed May 3, 2016
1 parent 490bcec commit 329c55e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions js/jquery.galleryview-3.0-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,16 +657,17 @@ if (typeof Object.create !== 'function') {

autoShowOverlay: function(i) {
if (this.opts.overlay_visible == "auto") {
if (
this.gvImages[i].attrs.description.replace(/^\s+|\s+$/g, '') != '' &&
this.gvImages[i].attrs.title.replace(/^\s+|\s+$/g, '') != ''
)
this.showOverlay()
else
this.hideOverlay()

// show the overlay if either the
// title or caption/description is not empty.
if ( this.gvImages[i].attrs.description.trim() ||
this.gvImages[i].attrs.title.trim()
) {
this.showOverlay();
} else {
this.hideOverlay();
}
} else if (this.opts.overlay_visible) {
this.showOverlay()
this.showOverlay();
}
},

Expand Down

0 comments on commit 329c55e

Please sign in to comment.