diff options
| author | shpuld <shp@cock.li> | 2019-02-05 17:17:50 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-02-05 17:17:50 +0200 |
| commit | 5974dfebfb764c94acea04b64f072f1d37f4e1c9 (patch) | |
| tree | 215ee79f4b48a759d2073f7319d930dbdd76319d | |
| parent | 448317338ea585502c0bca03151fc9f3e50aba2e (diff) | |
Fix mishandled @error in stillImage
| -rw-r--r-- | src/components/still-image/still-image.js | 3 | ||||
| -rw-r--r-- | src/components/still-image/still-image.vue | 2 | ||||
| -rw-r--r-- | src/components/user_avatar/user_avatar.vue | 7 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index 8f3a7206..02e98f19 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -24,6 +24,9 @@ const StillImage = { canvas.width = width canvas.height = height canvas.getContext('2d').drawImage(this.$refs.src, 0, 0, width, height) + }, + onError () { + this.imageLoadError && this.imageLoadError() } } } diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 29c59e42..af824fa2 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -1,7 +1,7 @@ <template> <div class='still-image' :class='{ animated: animated }' > <canvas ref="canvas" v-if="animated"></canvas> - <img ref="src" :src="src" :referrerpolicy="referrerpolicy" v-on:load="onLoad" @error="imageLoadError"/> + <img ref="src" :src="src" :referrerpolicy="referrerpolicy" v-on:load="onLoad" @error="onError"/> </div> </template> diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 3ec25b21..6bf7123d 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -1,5 +1,10 @@ <template> - <StillImage class="avatar" :class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }" :src="imgSrc" :imageLoadError="imageLoadError"/> + <StillImage + class="avatar" + :class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }" + :src="imgSrc" + :imageLoadError="imageLoadError" + /> </template> <script src="./user_avatar.js"></script> |
