Skip to content

Commit

Permalink
fix: atag image get source url
Browse files Browse the repository at this point in the history
  • Loading branch information
wssgcg1213 committed Nov 12, 2018
1 parent 365eee1 commit 16567ce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/atag/src/components/image/index.js
Expand Up @@ -99,7 +99,7 @@ export default class ImageElement extends PolymerElement {
this.state = LOADING;
const image = this.image = new Image();

image.onload = e => {
image.onload = (evt) => {
this.state = DONE;

if (this._needAdaptHeight) {
Expand All @@ -118,7 +118,7 @@ export default class ImageElement extends PolymerElement {
this.dispatchEvent(customEvent);
};

image.onerror = e => {
image.onerror = (evt) => {
this.state = DONE;
const customEvent = new CustomEvent('error', {
bubbles: false,
Expand All @@ -129,7 +129,7 @@ export default class ImageElement extends PolymerElement {
});
this.dispatchEvent(customEvent);
};
image.src = this.src;
image.src = this._getSourceUrl();
this._render();
}

Expand Down Expand Up @@ -272,7 +272,6 @@ export default class ImageElement extends PolymerElement {
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-size: 100%;
}
</style>
<div id="container"></div>
Expand Down

0 comments on commit 16567ce

Please sign in to comment.