CardLoader.load now checks for ready state.
This commit is contained in:
parent
129672eb0f
commit
6445ab3f57
@ -352,7 +352,7 @@ export default class Highlight extends Object {
|
|||||||
target.classList.remove(Highlight.expandedClass)
|
target.classList.remove(Highlight.expandedClass)
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
let [mask, maskImage] = Highlight._getSVGMask(target)
|
let [mask, maskImage] = Highlight._getSVGMask(target)
|
||||||
console.log('Close Highlight', maskImage)
|
// console.log('Close Highlight', maskImage)
|
||||||
TweenLite.to([target, maskImage], animation, {
|
TweenLite.to([target, maskImage], animation, {
|
||||||
scale: 1
|
scale: 1
|
||||||
})
|
})
|
||||||
|
@ -141,13 +141,15 @@ export class HTMLLoader extends CardLoader {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let xhr = new XMLHttpRequest()
|
let xhr = new XMLHttpRequest()
|
||||||
xhr.open('GET', this.src, false)
|
xhr.open('GET', this.src, false)
|
||||||
xhr.onload = e => {
|
xhr.onreadystatechange = e => {
|
||||||
domNode.innerHTML = this.prepare(xhr.response)
|
if (xhr.readyState == 4) {
|
||||||
this.addedNode = domNode.firstElementChild
|
domNode.innerHTML = this.prepare(xhr.response)
|
||||||
let { width, height } = this.size(this.addedNode)
|
this.addedNode = domNode.firstElementChild
|
||||||
if (width) this.wantedWidth = width || this.wantedWidth
|
let { width, height } = this.size(this.addedNode)
|
||||||
if (height) this.wantedHeight = height || this.wantedHeight
|
if (width) this.wantedWidth = width || this.wantedWidth
|
||||||
resolve(this)
|
if (height) this.wantedHeight = height || this.wantedHeight
|
||||||
|
resolve(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
xhr.onerror = e => {
|
xhr.onerror = e => {
|
||||||
reject(this)
|
reject(this)
|
||||||
|
Loading…
Reference in New Issue
Block a user