diff options
author | Olivier Paroz <oparoz@users.noreply.github.com> | 2015-09-12 20:54:05 +0300 |
---|---|---|
committer | Olivier Paroz <oparoz@users.noreply.github.com> | 2015-09-12 20:54:05 +0300 |
commit | ec9be244d488b924432c45686b0255adede8d215 (patch) | |
tree | 082b18b6efd149449eb42553ed672ff38ae6a4d5 /js/galleryfileaction.js | |
parent | cc355db09941bbeb393e3715165c7f392272c1a0 (diff) | |
parent | 5d25d162b0c0db2fccca483a79e0a6b9c0f17067 (diff) |
Merge pull request #323 from owncloud/hide-brightness-button
Hide brightness button
Diffstat (limited to 'js/galleryfileaction.js')
-rw-r--r-- | js/galleryfileaction.js | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/js/galleryfileaction.js b/js/galleryfileaction.js index 8b140961..c1953f9f 100644 --- a/js/galleryfileaction.js +++ b/js/galleryfileaction.js @@ -2,7 +2,7 @@ (function ($, OC, OCA, oc_requesttoken) { "use strict"; var galleryFileAction = { - config: null, + features: [], mediaTypes: {}, scrollContainer: null, slideShow: null, @@ -52,6 +52,25 @@ }, /** + * Prepares the features array + * + * @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); + } + } + + window.galleryFileAction.features = features; + }, + + /** * Builds an array containing all the images we can show in the slideshow * * @param {string} filename @@ -114,10 +133,15 @@ if ($.isEmptyObject(galleryFileAction.slideShow)) { galleryFileAction.slideShow = new SlideShow(); - $.when(galleryFileAction.slideShow.init(false, null)) - .then(function () { - galleryFileAction._startSlideshow(images, start); - }); + $.when(galleryFileAction.slideShow.init( + false, + null, + window.galleryFileAction.features + )).then(function () { + // Don't show the download button on the "Files" slideshow + galleryFileAction.slideShow.removeButton('.downloadImage'); + galleryFileAction._startSlideshow(images, start); + }); } else { galleryFileAction._startSlideshow(images, start); } @@ -177,9 +201,7 @@ $(document).ready(function () { // The list of media files is retrieved when the user clicks on a row var url = window.galleryFileAction.buildGalleryUrl('config', '', {extramediatypes: 1}); $.getJSON(url).then(function (config) { - if (!$.isEmptyObject(config.features)) { - window.galleryFileAction.config = config.features; - } + window.galleryFileAction.buildFeaturesList(config.features); window.galleryFileAction.register(config.mediatypes); }); }); |