Skip to content

Commit

Permalink
Merge pull request #312 from Sija/rename-caption-class-name
Browse files Browse the repository at this point in the history
Rename generic .caption(-{visible,hidden}) css classes to .jg-caption…
  • Loading branch information
miromannino committed Jul 11, 2019
2 parents 69b5b9a + 119bd32 commit a490305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/js/justifiedGallery.js
Expand Up @@ -160,7 +160,7 @@ JustifiedGallery.prototype.imgFromEntry = function ($entry) {

/** @returns {jQuery} the caption in the given entry */
JustifiedGallery.prototype.captionFromEntry = function ($entry) {
var $caption = $entry.find('> .caption');
var $caption = $entry.find('> .jg-caption');
return $caption.length === 0 ? null : $caption;
};

Expand Down Expand Up @@ -236,7 +236,7 @@ JustifiedGallery.prototype.displayEntryCaption = function ($entry) {
var caption = $image.attr('alt');
if (!this.isValidCaption(caption)) caption = $entry.attr('title');
if (this.isValidCaption(caption)) { // Create only we found something
$imgCaption = $('<div class="caption">' + caption + '</div>');
$imgCaption = $('<div class="jg-caption">' + caption + '</div>');
$entry.append($imgCaption);
$entry.data('jg.createdCaption', true);
}
Expand Down Expand Up @@ -271,7 +271,7 @@ JustifiedGallery.prototype.isValidCaption = function (caption) {
JustifiedGallery.prototype.onEntryMouseEnterForCaption = function (eventObject) {
var $caption = this.captionFromEntry($(eventObject.currentTarget));
if (this.settings.cssAnimation) {
$caption.addClass('caption-visible').removeClass('caption-hidden');
$caption.addClass('jg-caption-visible').removeClass('jg-caption-hidden');
} else {
$caption.stop().fadeTo(this.settings.captionSettings.animationDuration,
this.settings.captionSettings.visibleOpacity);
Expand All @@ -287,7 +287,7 @@ JustifiedGallery.prototype.onEntryMouseEnterForCaption = function (eventObject)
JustifiedGallery.prototype.onEntryMouseLeaveForCaption = function (eventObject) {
var $caption = this.captionFromEntry($(eventObject.currentTarget));
if (this.settings.cssAnimation) {
$caption.removeClass('caption-visible').removeClass('caption-hidden');
$caption.removeClass('jg-caption-visible').removeClass('jg-caption-hidden');
} else {
$caption.stop().fadeTo(this.settings.captionSettings.animationDuration,
this.settings.captionSettings.nonVisibleOpacity);
Expand Down
4 changes: 2 additions & 2 deletions src/less/justifiedGallery.less
Expand Up @@ -44,7 +44,7 @@
.opacity(0);
}

> .caption {
> .jg-caption {
& when (@caption-initial-opacity = 0) {
display: none;
}
Expand All @@ -65,7 +65,7 @@
font-family: sans-serif;
}

> .caption.caption-visible {
> .jg-caption.jg-caption-visible {
display: initial;
.opacity(@caption-visible-opacity);
.transition(opacity);
Expand Down

0 comments on commit a490305

Please sign in to comment.