Merge branch 'feature/export-progress' of https://github.com/vabene1111/recipes into feature/export-progress

This commit is contained in:
vabene1111
2022-02-03 15:59:18 +01:00
26 changed files with 1240 additions and 100 deletions

View File

@ -100,7 +100,7 @@
<div class="col-12 order-1 col-sm-12 order-sm-1 col-md-6 order-md-2">
<div class="row">
<div class="col-12">
<img class="img img-fluid rounded" :src="recipe.image" style="max-height: 30vh" :alt="$t('Recipe_Image')" v-if="recipe.image !== null" />
<img class="img img-fluid rounded" :src="recipe.image" style="max-height: 30vh" :alt="$t('Recipe_Image')" v-if="recipe.image !== null" @load="onImgLoad" />
</div>
</div>
@ -241,6 +241,9 @@ export default {
this.start_time = moment().format("yyyy-MM-DDTHH:mm")
}
if(recipe.image === null) this.printReady()
this.recipe = this.rootrecipe = recipe
this.servings = this.servings_cache[this.rootrecipe.id] = recipe.servings
this.loading = false
@ -267,6 +270,14 @@ export default {
this.servings = this.servings_cache?.[e.id] ?? e.servings
}
},
printReady: function(){
const template = document.createElement("template");
template.id = "printReady";
document.body.appendChild(template);
},
onImgLoad: function(){
this.printReady()
},
},
}
</script>