aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2023-09-22 11:47:47 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-09-26 20:22:10 +0200
commite3b2af4d9cc13853a3ed6970ec652915414d094a (patch)
tree437f6aa17ecfa2782ec3a7f3b506a8209034258b /apps
parentf9d2e3af0cfb087ed57c8c4a445618e0d24dde8f (diff)
downloadnextcloud-server-e3b2af4d9cc13853a3ed6970ec652915414d094a.tar.gz
nextcloud-server-e3b2af4d9cc13853a3ed6970ec652915414d094a.zip
fix(files): preview loading
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/appinfo/info.xml3
-rw-r--r--apps/files/src/components/FileEntry.vue18
2 files changed, 12 insertions, 9 deletions
diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml
index 12384b9f184..f7c2150bc45 100644
--- a/apps/files/appinfo/info.xml
+++ b/apps/files/appinfo/info.xml
@@ -5,8 +5,9 @@
<name>Files</name>
<summary>File Management</summary>
<description>File Management</description>
- <version>1.23.0</version>
+ <version>2.0.0</version>
<licence>agpl</licence>
+ <author>John Molakvoæ</author>
<author>Robin Appelman</author>
<author>Vincent Petry</author>
<types>
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 3cef907990c..2ca02edc5b8 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -60,11 +60,14 @@
</template>
<!-- Decorative image, should not be aria documented -->
- <img v-else-if="previewUrl && !backgroundFailed"
+ <img v-else-if="previewUrl && backgroundFailed !== true"
ref="previewImg"
+ alt=""
class="files-list__row-icon-preview"
+ :class="{'files-list__row-icon-preview--loaded': backgroundFailed === false}"
:src="previewUrl"
- @error="backgroundFailed = true">
+ @error="backgroundFailed = true"
+ @load="backgroundFailed = false">
<FileIcon v-else />
@@ -77,7 +80,7 @@
</span>
<!-- Rename input -->
- <form v-show="isRenaming"
+ <form v-if="isRenaming"
v-on-click-outside="stopRenaming"
:aria-hidden="!isRenaming"
:aria-label="t('files', 'Rename file')"
@@ -94,7 +97,7 @@
@keyup.esc="stopRenaming" />
</form>
- <a v-show="!isRenaming"
+ <a v-else
ref="basename"
:aria-hidden="isRenaming"
class="files-list__row-name-link"
@@ -309,8 +312,7 @@ export default Vue.extend({
data() {
return {
- dummyPreviewUrl: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',
- backgroundFailed: false,
+ backgroundFailed: undefined,
loading: '',
dragover: false,
@@ -651,7 +653,7 @@ export default Vue.extend({
this.loading = ''
// Reset background state
- this.backgroundFailed = false
+ this.backgroundFailed = undefined
if (this.$refs.previewImg) {
this.$refs.previewImg.src = ''
}
@@ -1030,7 +1032,7 @@ tr {
}
/* Preview not loaded animation effect */
-.files-list__row-icon-preview:not([style*='background']) {
+.files-list__row-icon-preview:not(.files-list__row-icon-preview--loaded) {
background: var(--color-loading-dark);
// animation: preview-gradient-fade 1.2s ease-in-out infinite;
}