Skip to content

Commit

Permalink
chore(Gcodefiles.vue): simplify code
Browse files Browse the repository at this point in the history
use the `disabled` prop of v-tooltip to check for the existence of a big thumbnail

saves duplicated template code

Signed-off-by: Dominik Willner <[email protected]>
  • Loading branch information
dw-0 committed Jun 16, 2022
1 parent 4792101 commit 06d4f7b
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/components/panels/Status/Gcodefiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
@contextmenu="showContextMenu($event, item)"
@click="showDialog(item)">
<td class="pr-0 text-center" style="width: 32px">
<template v-if="item.small_thumbnail && item.big_thumbnail">
<v-tooltip top content-class="tooltip__content-opacity1">
<template v-if="item.small_thumbnail">
<v-tooltip top content-class="tooltip__content-opacity1" :disabled="!item.big_thumbnail">
<template #activator="{ on, attrs }">
<vue-load-image class="d-flex">
<img
Expand All @@ -42,22 +42,6 @@
<span><img :src="item.big_thumbnail" alt="big_thumbnail" width="250" /></span>
</v-tooltip>
</template>
<template v-else-if="item.small_thumbnail">
<vue-load-image>
<img
slot="image"
:src="item.small_thumbnail"
alt="small_thumbnail"
width="32"
height="32" />
<div slot="preloader">
<v-progress-circular indeterminate color="primary"></v-progress-circular>
</div>
<div slot="error">
<v-icon>{{ mdiFile }}</v-icon>
</div>
</vue-load-image>
</template>
<template v-else>
<v-icon>{{ mdiFile }}</v-icon>
</template>
Expand Down

0 comments on commit 06d4f7b

Please sign in to comment.