|
23 | 23 | :force-display-actions="true" |
24 | 24 | data-files-versions-version> |
25 | 25 | <template #icon> |
26 | | - <img lazy="true" |
| 26 | + <img v-if="!previewError" |
27 | 27 | :src="previewURL" |
28 | 28 | alt="" |
29 | | - height="256" |
30 | | - width="256" |
| 29 | + class="version__image" |
| 30 | + @error="previewError = true"> |
| 31 | + <div v-else |
31 | 32 | class="version__image"> |
| 33 | + <ImageOffOutline :size="20" /> |
| 34 | + </div> |
32 | 35 | </template> |
33 | 36 | <template #subtitle> |
34 | 37 | <div class="version__info"> |
@@ -112,6 +115,7 @@ import Download from 'vue-material-design-icons/Download.vue' |
112 | 115 | import Pencil from 'vue-material-design-icons/Pencil.vue' |
113 | 116 | import Check from 'vue-material-design-icons/Check.vue' |
114 | 117 | import Delete from 'vue-material-design-icons/Delete.vue' |
| 118 | +import ImageOffOutline from 'vue-material-design-icons/ImageOffOutline.vue' |
115 | 119 | import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' |
116 | 120 | import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js' |
117 | 121 | import NcListItem from '@nextcloud/vue/dist/Components/NcListItem.js' |
@@ -139,6 +143,7 @@ export default { |
139 | 143 | Pencil, |
140 | 144 | Check, |
141 | 145 | Delete, |
| 146 | + ImageOffOutline, |
142 | 147 | }, |
143 | 148 | directives: { |
144 | 149 | tooltip: Tooltip, |
@@ -183,6 +188,7 @@ export default { |
183 | 188 | showVersionLabelForm: false, |
184 | 189 | formVersionLabelValue: this.version.label, |
185 | 190 | capabilities: loadState('core', 'capabilities', { files: { version_labeling: false, version_deletion: false } }), |
| 191 | + previewError: false, |
186 | 192 | } |
187 | 193 | }, |
188 | 194 | computed: { |
@@ -283,6 +289,11 @@ export default { |
283 | 289 | height: 3rem; |
284 | 290 | border: 1px solid var(--color-border); |
285 | 291 | border-radius: var(--border-radius-large); |
| 292 | +
|
| 293 | + // Useful to display no preview icon. |
| 294 | + display: flex; |
| 295 | + justify-content: center; |
| 296 | + color: var(--color-main-text); |
286 | 297 | } |
287 | 298 | } |
288 | 299 |
|
|
0 commit comments