diff options
author | Olivier Paroz <oparoz@users.noreply.github.com> | 2015-09-14 15:22:37 +0300 |
---|---|---|
committer | Olivier Paroz <oparoz@users.noreply.github.com> | 2015-09-14 15:22:37 +0300 |
commit | d0823b3a3ea387d7b0679c5ebf86f8342911edb7 (patch) | |
tree | 9d01027877c80df7bb2c83e2163c403b70effd26 | |
parent | db937846a2b4c8681ffc609a74f0c31e08b5b3c9 (diff) | |
parent | 3d5eebd57f8c658b1382420d03ecbe225f45ec20 (diff) |
Merge pull request #339 from owncloud/more-fixes
More fixes
-rw-r--r-- | js/galleryfileaction.js | 12 | ||||
-rw-r--r-- | js/galleryview.js | 2 | ||||
-rw-r--r-- | js/slideshow.js | 3 | ||||
-rw-r--r-- | js/slideshowcontrols.js | 36 | ||||
-rw-r--r-- | templates/slideshow.php | 4 |
5 files changed, 37 insertions, 20 deletions
diff --git a/js/galleryfileaction.js b/js/galleryfileaction.js index 88a4a7cd..e0a74645 100644 --- a/js/galleryfileaction.js +++ b/js/galleryfileaction.js @@ -53,16 +53,18 @@ /** * Prepares the features array * + * This is duplicated from a method found in galleryconfig. It's done that way in order to + * avoid having to load the whole utility class in the Files app + * * @param configFeatures * @returns {Array} */ buildFeaturesList: function (configFeatures) { var features = []; - var feature = null; - if (!$.isEmptyObject(configFeatures)) { - for (var i = 0, keys = Object.keys(configFeatures); i < keys.length; i++) { - feature = keys[i]; - features.push(feature); + var i, configFeaturesLength = configFeatures.length; + if (configFeaturesLength) { + for (i = 0; i < configFeaturesLength; i++) { + features.push(configFeatures[i]); } } diff --git a/js/galleryview.js b/js/galleryview.js index 37a7a7b6..8872d74b 100644 --- a/js/galleryview.js +++ b/js/galleryview.js @@ -302,7 +302,7 @@ var wrapper = $('#content-wrapper'); var albumInfo = Gallery.config.albumInfo; if (!$.isEmptyObject(albumInfo) && albumInfo.background) { - wrapper.css('background-color', '#' + albumInfo.background); + wrapper.css('background-color', albumInfo.background); } else { wrapper.css('background-color', '#fff'); } diff --git a/js/slideshow.js b/js/slideshow.js index f4c35f6a..75bd3451 100644 --- a/js/slideshow.js +++ b/js/slideshow.js @@ -108,7 +108,7 @@ return this.loadImage(this.images[index]).then(function (img) { this.spinner.stop(this.spinnerDiv); this.container.css('background-position', '-10000px 0'); - this.controls.showBackgroundToggle(); + this.controls.showActionButtons(); // check if we moved along while we were loading if (currentImageId === index) { @@ -313,6 +313,7 @@ _hideImage: function () { this.zoomablePreviewContainer.empty(); this.spinner.spin(this.spinnerDiv); + this.controls.hideActionButtons(); }, /** diff --git a/js/slideshowcontrols.js b/js/slideshowcontrols.js index 5e54146a..d9103ea6 100644 --- a/js/slideshowcontrols.js +++ b/js/slideshowcontrols.js @@ -63,8 +63,8 @@ // Hide prev/next and play buttons when we only have one pic this.container.find('.next, .previous, .play').toggle(this.images.length > 1); - // Hide the toggle background button until we have something to show - this.hideButton('.changeBackground'); + // Hide the action buttons until we have something to show + this.hideActionButtons(); if (autoPlay) { this._play(); @@ -109,21 +109,26 @@ }, /** - * Shows the background colour switcher, if activated in the configuration + * Shows the action buttons */ - showBackgroundToggle: function () { - if (this.backgroundToggle) { - this.showButton('.changeBackground'); - } + showActionButtons: function () { + this._showBackgroundToggle(); + this.showButton('.downloadImage'); + }, + + /** + * Hides the action buttons + */ + hideActionButtons: function () { + this.hideButton('.changeBackground'); + this.hideButton('.downloadImage'); }, /** * Shows a button which has been hidden */ showButton: function (button) { - if (this.backgroundToggle) { - this.container.find(button).show(); - } + this.container.find(button).removeClass('hidden'); }, /** @@ -132,7 +137,7 @@ * @param button */ hideButton: function (button) { - this.container.find(button).hide(); + this.container.find(button).addClass('hidden'); }, /** @@ -179,6 +184,15 @@ }, /** + * Shows the background colour switcher, if activated in the configuration + */ + _showBackgroundToggle: function () { + if (this.backgroundToggle) { + this.showButton('.changeBackground'); + } + }, + + /** * Sets up the key based controls * * @param {Function} makeCallBack diff --git a/templates/slideshow.php b/templates/slideshow.php index 37cd9b24..9c41321c 100644 --- a/templates/slideshow.php +++ b/templates/slideshow.php @@ -6,8 +6,8 @@ <input type="button" class="svg exit icon-view-close"/> <div class="menu"> - <input type="button" class="menuItem svg downloadImage icon-view-download"/> - <input type="button" class="menuItem svg changeBackground icon-view-toggle-background"/> + <input type="button" class="menuItem svg downloadImage icon-view-download hidden"/> + <input type="button" class="menuItem svg changeBackground icon-view-toggle-background hidden"/> </div> <div class="progress icon-view-pause"/> <div class="notification"></div> |