Skip to content

Commit

Permalink
fix(files): preview loading
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Sep 26, 2023
1 parent de3782e commit df8e040
Show file tree
Hide file tree
Showing 104 changed files with 161 additions and 181 deletions.
18 changes: 10 additions & 8 deletions apps/files/src/components/FileEntry.vue
Expand Up @@ -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 />

Expand All @@ -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')"
Expand All @@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 = ''
}
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions dist/1567-1567.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/1567-1567.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/2719-2719.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/2719-2719.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/5912-5912.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/5912-5912.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/5941-5941.js

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions dist/1567-1567.js.LICENSE.txt → dist/5941-5941.js.LICENSE.txt
Expand Up @@ -26,28 +26,6 @@

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/**
* @copyright 2022 Louis Chmn <louis@chmn.me>
*
* @author Louis Chmn <louis@chmn.me>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
Expand Down
1 change: 1 addition & 0 deletions dist/5941-5941.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-maintenance.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/core-maintenance.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-profile.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-profile.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-recommendedapps.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-recommendedapps.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unified-search.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dashboard-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dashboard-main.js.map

Large diffs are not rendered by default.

0 comments on commit df8e040

Please sign in to comment.