diff options
Diffstat (limited to 'js/galleryview.js')
-rw-r--r-- | js/galleryview.js | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/js/galleryview.js b/js/galleryview.js index 499808ef..07e3120f 100644 --- a/js/galleryview.js +++ b/js/galleryview.js @@ -253,14 +253,15 @@ infoButton.find('span').hide(); var infoContentContainer = $('.album-info-container'); infoContentContainer.slideUp(); - infoContentContainer.css('max-height', $(window).height() - Gallery.browserToolbarHeight); + infoContentContainer.css('max-height', + $(window).height() - Gallery.browserToolbarHeight); var albumInfo = Gallery.config.albumInfo; if (Gallery.config.albumError) { infoButton.hide(); var text = '<strong>' + t('gallery', 'Configuration error') + '</strong></br>' + Gallery.config.albumError.message + '</br></br>'; Gallery.utility.showHtmlNotification(text, 7); - } else if ($.isEmptyObject(albumInfo)) { + } else if (this._isInfoContentEmpty(albumInfo)) { infoButton.hide(); } else { infoButton.show(); @@ -271,6 +272,23 @@ }, /** + * Determines if the info box is empty + * + * @param albumInfo + * @returns {bool} + * @private + */ + _isInfoContentEmpty: function (albumInfo) { + return $.isEmptyObject(albumInfo) + || ( + !albumInfo.description + && !albumInfo.descriptionLink + && !albumInfo.copyright + && !albumInfo.copyrightLink + ); + }, + + /** * Sets the background colour of the photowall * * @private |