From 31311c9fe0606fc9c031bf3137f25c455b3b94ed Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Sun, 13 Sep 2015 02:24:37 +0200 Subject: Make the background colour of the photowall user configurable --- js/galleryview.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'js/galleryview.js') diff --git a/js/galleryview.js b/js/galleryview.js index 23ec59eb..93339fde 100644 --- a/js/galleryview.js +++ b/js/galleryview.js @@ -53,6 +53,7 @@ $('#save #save-button').click(Gallery.showSaveForm); $('.save-form').submit(Gallery.saveForm); } + this._setBackgroundColour(); this.viewAlbum(albumPath); } }, @@ -234,8 +235,9 @@ var currentSort = Gallery.config.albumSorting; this.sortControlsSetup(currentSort.type, currentSort.order); - Gallery.albumMap[Gallery.currentAlbum].images.sort(Gallery.utility.sortBy(currentSort.type, - currentSort.order)); + Gallery.albumMap[Gallery.currentAlbum].images.sort( + Gallery.utility.sortBy(currentSort.type, + currentSort.order)); Gallery.albumMap[Gallery.currentAlbum].subAlbums.sort(Gallery.utility.sortBy('name', currentSort.albumOrder)); }, @@ -280,6 +282,21 @@ infoButton.find('span').delay(1000).slideDown(); } } + }, + + /** + * Sets the background colour of the photowall + * + * @private + */ + _setBackgroundColour: function () { + var wrapper = $('#content-wrapper'); + var albumInfo = Gallery.config.albumInfo; + if (!$.isEmptyObject(albumInfo) && albumInfo.background) { + wrapper.css('background-color', '#' + albumInfo.background); + } else { + wrapper.css('background-color', '#fff'); + } } }; -- cgit v1.2.3