diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-09-01 06:51:29 +0200 |
---|---|---|
committer | npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com> | 2020-10-16 07:10:00 +0000 |
commit | f612c264bbd21288e41866756bb151e133686df3 (patch) | |
tree | 364843f65670290064479d8b6385a2993bb13785 /src/components/File.vue | |
parent | 14addf399445650c53cf12238815e36ab9da5b3e (diff) |
Non-cropped layout
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'src/components/File.vue')
-rw-r--r-- | src/components/File.vue | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/components/File.vue b/src/components/File.vue index 591a78b9..73c7dffe 100644 --- a/src/components/File.vue +++ b/src/components/File.vue @@ -21,7 +21,10 @@ --> <template> - <a :class="{'file--clear': !loaded}" + <a :class="{ + 'file--clear': !loaded, + 'file--cropped': croppedLayout, + }" class="file" :href="davPath" :aria-label="ariaLabel" @@ -54,10 +57,12 @@ import { generateRemoteUrl, generateUrl } from '@nextcloud/router' import { getCurrentUser } from '@nextcloud/auth' +import UserConfig from '../mixins/UserConfig' + export default { name: 'File', + mixins: [UserConfig], inheritAttrs: false, - props: { item: { type: Object, @@ -85,7 +90,7 @@ export default { return this.item.injected.mime.startsWith('image') }, src() { - return generateUrl(`/core/preview?fileId=${this.item.injected.fileid}&x=${256}&y=${256}&a=false&v=${this.item.injected.etag}`) + return generateUrl(`/core/preview?fileId=${this.item.injected.fileid}&x=${256}&y=${256}&a=${!this.croppedLayout}&v=${this.item.injected.etag}`) }, }, @@ -127,7 +132,11 @@ img { width: 100%; height: 100%; - object-fit: cover; + object-fit: contain; + + .file--cropped & { + object-fit: cover; + } } svg { |