diff --git a/lib/card/highlight.js b/lib/card/highlight.js index 591307d..0950512 100644 --- a/lib/card/highlight.js +++ b/lib/card/highlight.js @@ -352,7 +352,7 @@ export default class Highlight extends Object { target.classList.remove(Highlight.expandedClass) // eslint-disable-next-line no-unused-vars let [mask, maskImage] = Highlight._getSVGMask(target) - console.log('Close Highlight', maskImage) + // console.log('Close Highlight', maskImage) TweenLite.to([target, maskImage], animation, { scale: 1 }) diff --git a/lib/flippable.js b/lib/flippable.js index 4b6d97d..bf87b31 100644 --- a/lib/flippable.js +++ b/lib/flippable.js @@ -141,13 +141,15 @@ export class HTMLLoader extends CardLoader { return new Promise((resolve, reject) => { let xhr = new XMLHttpRequest() xhr.open('GET', this.src, false) - xhr.onload = e => { - domNode.innerHTML = this.prepare(xhr.response) - this.addedNode = domNode.firstElementChild - let { width, height } = this.size(this.addedNode) - if (width) this.wantedWidth = width || this.wantedWidth - if (height) this.wantedHeight = height || this.wantedHeight - resolve(this) + xhr.onreadystatechange = e => { + if (xhr.readyState == 4) { + domNode.innerHTML = this.prepare(xhr.response) + this.addedNode = domNode.firstElementChild + let { width, height } = this.size(this.addedNode) + if (width) this.wantedWidth = width || this.wantedWidth + if (height) this.wantedHeight = height || this.wantedHeight + resolve(this) + } } xhr.onerror = e => { reject(this)