diff --git a/CHANGELOG.md b/CHANGELOG.md index 877b98dd4..b2026902c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,6 +102,8 @@ [#447](https://github.com/nextcloud/cookbook/pull/447) @christianlupus - Recipe-editing Vue components are not tightly coupled anymore [#386](https://github.com/nextcloud/cookbook/pull/386/) @seyfeb +- Fixed trying to remove already removed img DOM nodes in image lazyloading, fixes #462 + [#463](https://github.com/nextcloud/cookbook/pull/463/) @seyfeb ### Removed - Travis build system diff --git a/src/components/LazyPicture.vue b/src/components/LazyPicture.vue index 80aaa5af8..5ed7905cd 100644 --- a/src/components/LazyPicture.vue +++ b/src/components/LazyPicture.vue @@ -87,11 +87,14 @@ export default { // callback for fully-loaded image event const onThumbnailFullyLoaded = () => { + img.removeEventListener('load', onThumbnailFullyLoaded) el.removeChild(imgPlaceholder) $this.isLoading = false } + // callback for preview-image-loaded event const onThumbnailPreviewLoaded = () => { + imgPlaceholder.removeEventListener('load', onThumbnailPreviewLoaded) img.addEventListener('load', onThumbnailFullyLoaded) $this.$once('hook:destroyed', () => { img.removeEventListener('load', onThumbnailFullyLoaded)