[+] Create loadDimensions method

This commit is contained in:
Hykilpikonna
2019-12-24 22:39:15 -05:00
parent d4718d5ae6
commit 9f0d82ce7d
+12
View File
@@ -49,6 +49,18 @@ class Artwork
return './404.jpg'
}
}
loadDimensions()
{
let img = new Image();
img.onload = () =>
{
this.width = img.width;
this.height = img.height;
};
img.src = this.imgFull;
return this;
}
}
@Component({components: {PhotoSwipper}})