diff options
author | Olivier Paroz <github@oparoz.com> | 2015-09-13 03:24:37 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-09-13 03:24:37 +0300 |
commit | 31311c9fe0606fc9c031bf3137f25c455b3b94ed (patch) | |
tree | ccb93a887ac968f2119753d9fa84a0d2c510796a | |
parent | edc9a0133facd8fbecae6ea86ac22c5d210b0046 (diff) |
Make the background colour of the photowall user configurable
-rw-r--r-- | css/styles.css | 6 | ||||
-rw-r--r-- | js/galleryconfig.js | 3 | ||||
-rw-r--r-- | js/galleryview.js | 21 |
3 files changed, 28 insertions, 2 deletions
diff --git a/css/styles.css b/css/styles.css index d9ab3fe3..34fccc84 100644 --- a/css/styles.css +++ b/css/styles.css @@ -85,7 +85,13 @@ div.crumb.last a{ } #content-wrapper { + background-color: #fff; overflow-x: auto; + -webkit-transition: background-color 1s linear; + -moz-transition: background-color 1s linear; + -o-transition: background-color 1s linear; + -ms-transition: background-color 1s linear; + transition: background-color 1s linear; } #gallery.hascontrols { diff --git a/js/galleryconfig.js b/js/galleryconfig.js index 16882a8b..b0b8a430 100644 --- a/js/galleryconfig.js +++ b/js/galleryconfig.js @@ -184,6 +184,7 @@ * descriptionLink: string, * copyright: string, * copyrightLink: string, + * background: string, * filePath: string, * inherit: bool, * level: number @@ -198,6 +199,7 @@ * description_link: string, * copyright: string, * copyright_link: string, + * background: string, * inherit: bool, * level: number * }} @@ -223,6 +225,7 @@ descriptionLink: albumInfo.description_link, copyright: albumInfo.copyright, copyrightLink: albumInfo.copyright_link, + background: albumInfo.background, filePath: docPath, inherit: albumInfo.inherit, level: albumInfo.level 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'); + } } }; |