diff options
author | Olivier Paroz <github@oparoz.com> | 2015-09-12 20:34:27 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-09-12 20:34:27 +0300 |
commit | c2271b81abcf8ff4229ffa1f509a8e3fdcffb112 (patch) | |
tree | 228ed6a8c885438990b21cef8c02561abde82f11 /js | |
parent | f8cd486c996cdac3d21ff5c60d44eb43b39515fe (diff) |
Make the border optional, like the button
Diffstat (limited to 'js')
-rw-r--r-- | js/slideshow.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/js/slideshow.js b/js/slideshow.js index 37e9ecf9..5b809793 100644 --- a/js/slideshow.js +++ b/js/slideshow.js @@ -19,6 +19,7 @@ onStop: null, zoomablePreview: null, active: false, + backgroundToggle: false, /** * Initialises the slideshow @@ -28,9 +29,9 @@ * @param {Array} features */ init: function (autoPlay, interval, features) { - // FIXME: This should come from the configuration - /**@param {int} maxScale*/ - this.maxScale = 1; + if (features.indexOf('background_colour_toggle') > -1) { + this.backgroundToggle = true; + } return $.when(this._getSlideshowTemplate()).then(function ($tmpl) { // Move the slideshow outside the content so we can hide the content @@ -114,8 +115,10 @@ img.setAttribute('alt', image.name); $(img).css('position', 'absolute'); $(img).css('background-color', backgroundColour); - var $border = 30 / window.devicePixelRatio; - $(img).css('outline', $border + 'px solid ' + backgroundColour); + if (this.backgroundToggle === true) { + var $border = 30 / window.devicePixelRatio; + $(img).css('outline', $border + 'px solid ' + backgroundColour); + } // We cannot use nice things on IE8 if ($('html').is('.ie8')) { @@ -220,10 +223,14 @@ // Grey #363636 if (hex === "#000000") { container.css('background-color', '#FFF'); - container.css('outline', $border + 'px solid #FFF'); + if (this.backgroundToggle === true) { + container.css('outline', $border + 'px solid #FFF'); + } } else { container.css('background-color', '#000'); - container.css('outline', $border + 'px solid #000'); + if (this.backgroundToggle === true) { + container.css('outline', $border + 'px solid #000'); + } } }, |