Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-09-21 19:49:10 +0300
committerOlivier Paroz <github@oparoz.com>2015-09-21 19:49:10 +0300
commit3618021c137310647c8200e23e6ad56899db2062 (patch)
treecf63108a45911b8cd856735635705f1aa7ee118b /js/galleryview.js
parent558186a025ee6585d6f5016f933bc1f700fb57ee (diff)
Hide infobutton if config only contains colour info
[ci skip]
Diffstat (limited to 'js/galleryview.js')
-rw-r--r--js/galleryview.js22
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