diff --git a/apps/files/css/detailsView.css b/apps/files/css/detailsView.css index ffead923124..8eded7acda1 100644 --- a/apps/files/css/detailsView.css +++ b/apps/files/css/detailsView.css @@ -19,6 +19,27 @@ float: left; } +#app-sidebar .thumbnailContainer.image { + margin-left: -15px; + margin-right: -35px; /* 15 + 20 for the close button */ + margin-top: -15px; +} + +#app-sidebar .image .thumbnail { + width:100%; + display:block; + height: 250px; + background-repeat: no-repeat; + background-position: 50% top; + background-size: 100%; + float: none; + margin: 0; +} + +#app-sidebar .image.portrait .thumbnail { + background-size: contain; +} + #app-sidebar .thumbnail { width: 75px; height: 75px; diff --git a/apps/files/js/fileinfomodel.js b/apps/files/js/fileinfomodel.js index 05060854fba..1c850239cdc 100644 --- a/apps/files/js/fileinfomodel.js +++ b/apps/files/js/fileinfomodel.js @@ -52,6 +52,15 @@ return this.get('mimetype') === 'httpd/unix-directory'; }, + /** + * Returns whether this file is an image + * + * @return {boolean} true if this is an image, false otherwise + */ + isImage: function() { + return this.get('mimetype').substr(0, 6) === 'image/'; + }, + /** * Returns the full path to this file * diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index ac96d587015..9593ee79e66 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1359,6 +1359,12 @@ if (options.y) { urlSpec.y = options.y; } + if (options.a) { + urlSpec.a = options.a; + } + if (options.mode) { + urlSpec.mode = options.mode; + } if (etag){ // use etag as cache buster @@ -1377,9 +1383,14 @@ img.onload = function(){ // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 if (img.width > 5) { - ready(previewURL); + ready(previewURL, img); + } else if (options.error) { + options.error(); } }; + if (options.error) { + img.onerror = options.error; + } img.src = previewURL; }, diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js index e33c0edb1d6..785eed8d712 100644 --- a/apps/files/js/mainfileinfodetailview.js +++ b/apps/files/js/mainfileinfodetailview.js @@ -10,7 +10,7 @@ (function() { var TEMPLATE = - '' + + '
' + '