mirror of
https://github.com/MarcZierle/photo-log-frontend.git
synced 2025-04-19 02:14:38 +00:00
add timeout for refreshing loading spinner
This commit is contained in:
parent
80f1ff56ee
commit
7b6ad0c475
@ -213,21 +213,23 @@ export default {
|
|||||||
takePhoto() {
|
takePhoto() {
|
||||||
this.isPhotoTaken = true
|
this.isPhotoTaken = true
|
||||||
|
|
||||||
this.photo.height = document.getElementById('camera_preview').offsetHeight
|
setTimeout(() => {
|
||||||
|
this.photo.height = document.getElementById('camera_preview').offsetHeight
|
||||||
|
|
||||||
this.$refs.canvas.width = this.stream.width
|
this.$refs.canvas.width = this.stream.width
|
||||||
this.$refs.canvas.height = this.stream.height
|
this.$refs.canvas.height = this.stream.height
|
||||||
|
|
||||||
const context = this.$refs.canvas.getContext('2d')
|
const context = this.$refs.canvas.getContext('2d')
|
||||||
context.drawImage(
|
context.drawImage(
|
||||||
this.$refs.camera,
|
this.$refs.camera,
|
||||||
0, 0,
|
0, 0,
|
||||||
this.stream.width,
|
this.stream.width,
|
||||||
this.stream.height)
|
this.stream.height)
|
||||||
|
|
||||||
this.photo.src = this.$refs.canvas.toDataURL('image/png')//.replace('image/png', 'image/octet-stream')
|
this.photo.src = this.$refs.canvas.toDataURL('image/png')//.replace('image/png', 'image/octet-stream')
|
||||||
|
|
||||||
this.showPhotoTakenModal = true
|
this.showPhotoTakenModal = true
|
||||||
|
}, 50)
|
||||||
},
|
},
|
||||||
uploadPhoto() {
|
uploadPhoto() {
|
||||||
this.isUploading = true
|
this.isUploading = true
|
||||||
|
Loading…
Reference in New Issue
Block a user