Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-06-26 04:19:34 +0300
committerOlivier Paroz <github@oparoz.com>2015-06-26 04:19:34 +0300
commitbc5c176fb25bdaf0d74f3576d425c69262ab86d8 (patch)
tree18659bba8d2834096f9fcb5991978ecacd8fac01 /js/galleryfileaction.js
parent1b32faf94c023ecb43a05823b6dfa8d76cd9bf37 (diff)
Make native SVG support optional
Also made the app quicker by removing an HTTP request :)
Diffstat (limited to 'js/galleryfileaction.js')
-rw-r--r--js/galleryfileaction.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/js/galleryfileaction.js b/js/galleryfileaction.js
index 30a71a81..7ff9d3bf 100644
--- a/js/galleryfileaction.js
+++ b/js/galleryfileaction.js
@@ -63,10 +63,10 @@ var galleryFileAction = {
var height = Math.floor(screen.height * window.devicePixelRatio);
/* Find value of longest edge. */
- var longEdge = Math.max( width, height );
+ var longEdge = Math.max(width, height);
/* Find the next larger image size. */
- if ( longEdge % 100 !== 0 ){
+ if (longEdge % 100 !== 0) {
longEdge = ( longEdge + 100 ) - ( longEdge % 100 );
}
@@ -118,14 +118,13 @@ $(document).ready(function () {
return true;
}
- var url = galleryFileAction.buildGalleryUrl('config', '', {});
+ // We're also asking for a list of supported media types.
+ // Media files are retrieved through the Files context
+ var url = galleryFileAction.buildGalleryUrl('config', '', {slideshow: 1});
$.getJSON(url).then(function (config) {
- if (config) {
- galleryFileAction.config = config;
+ if (!$.isEmptyObject(config.features)) {
+ galleryFileAction.config = config.features;
}
- url = galleryFileAction.buildGalleryUrl('mediatypes', '', {slideshow: 1});
- // We're asking for a list of supported media types.
- // Media files are retrieved through the Files context
- $.getJSON(url, {}, galleryFileAction.register);
+ galleryFileAction.register(config.mediatypes);
});
});