From aaf037f92c1b14577252187d70c0439336344986 Mon Sep 17 00:00:00 2001 From: Jakub Kowalczyk Date: Fri, 26 Jul 2019 22:07:34 +0200 Subject: [PATCH] v2.2.1: fix changing active item when current item still loading --- package.json | 2 +- src/preview/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index df70c93..3512b2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jgallery", - "version": "2.2.0", + "version": "2.2.1", "description": "JGallery", "main": "dist/js/jgallery.js", "types": "types/index.d.ts", diff --git a/src/preview/index.ts b/src/preview/index.ts index 7a8bc39..ee148f7 100644 --- a/src/preview/index.ts +++ b/src/preview/index.ts @@ -85,9 +85,9 @@ export default class Preview extends Component { setItem(item: AlbumItem) { this.moveDistance = new Point; - const { element, title } = this; + const { element, content, title } = this; - this.content && this.element.removeChild(this.content); + content && content.parentElement === element && element.removeChild(content); this.content = createElement( item.element ? item.element.outerHTML :