@mekari/pixel-avatar
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -329,15 +329,17 @@ 'use strict'; | ||
loadImage(src) { | ||
if (!pixelUtils.canUseDOM) return; | ||
const image = new window.Image(); | ||
image.src = src; | ||
if (src) { | ||
if (!pixelUtils.canUseDOM) return; | ||
const image = new window.Image(); | ||
image.src = src; | ||
image.onload = e => { | ||
this.hasLoaded = true; | ||
this.$emit('load', e); | ||
}; | ||
image.onload = e => { | ||
this.hasLoaded = true; | ||
this.$emit('load', e); | ||
}; | ||
image.onerror = e => { | ||
this.hasLoaded = false; | ||
this.$emit('error', e); | ||
}; | ||
image.onerror = e => { | ||
this.hasLoaded = false; | ||
this.$emit('error', e); | ||
}; | ||
} | ||
} | ||
@@ -344,0 +346,0 @@ |
@@ -329,15 +329,17 @@ 'use strict'; | ||
loadImage(src) { | ||
if (!pixelUtils.canUseDOM) return; | ||
const image = new window.Image(); | ||
image.src = src; | ||
if (src) { | ||
if (!pixelUtils.canUseDOM) return; | ||
const image = new window.Image(); | ||
image.src = src; | ||
image.onload = e => { | ||
this.hasLoaded = true; | ||
this.$emit('load', e); | ||
}; | ||
image.onload = e => { | ||
this.hasLoaded = true; | ||
this.$emit('load', e); | ||
}; | ||
image.onerror = e => { | ||
this.hasLoaded = false; | ||
this.$emit('error', e); | ||
}; | ||
image.onerror = e => { | ||
this.hasLoaded = false; | ||
this.$emit('error', e); | ||
}; | ||
} | ||
} | ||
@@ -344,0 +346,0 @@ |
@@ -325,15 +325,17 @@ import { MpBox } from '@mekari/pixel-box'; | ||
loadImage(src) { | ||
if (!canUseDOM) return; | ||
const image = new window.Image(); | ||
image.src = src; | ||
if (src) { | ||
if (!canUseDOM) return; | ||
const image = new window.Image(); | ||
image.src = src; | ||
image.onload = e => { | ||
this.hasLoaded = true; | ||
this.$emit('load', e); | ||
}; | ||
image.onload = e => { | ||
this.hasLoaded = true; | ||
this.$emit('load', e); | ||
}; | ||
image.onerror = e => { | ||
this.hasLoaded = false; | ||
this.$emit('error', e); | ||
}; | ||
image.onerror = e => { | ||
this.hasLoaded = false; | ||
this.$emit('error', e); | ||
}; | ||
} | ||
} | ||
@@ -340,0 +342,0 @@ |
{ | ||
"name": "@mekari/pixel-avatar", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"description": "Mekari Pixel | Avatar component", | ||
@@ -5,0 +5,0 @@ "homepage": "https://mekari.design/", |
@@ -142,15 +142,17 @@ import { MpBox } from '@mekari/pixel-box' | ||
loadImage(src) { | ||
if (!canUseDOM) return | ||
if (src) { | ||
if (!canUseDOM) return | ||
const image = new window.Image() | ||
image.src = src | ||
image.onload = (e) => { | ||
this.hasLoaded = true | ||
this.$emit('load', e) | ||
const image = new window.Image() | ||
image.src = src | ||
image.onload = (e) => { | ||
this.hasLoaded = true | ||
this.$emit('load', e) | ||
} | ||
image.onerror = (e) => { | ||
this.hasLoaded = false | ||
this.$emit('error', e) | ||
} | ||
} | ||
image.onerror = (e) => { | ||
this.hasLoaded = false | ||
this.$emit('error', e) | ||
} | ||
} | ||
@@ -157,0 +159,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58358
2197