2019-03-24 07:23:38 +00:00
|
|
|
(() => {
|
|
|
|
addInitHook("end_init", () => {
|
2017-10-12 03:24:14 +00:00
|
|
|
// TODO: Run this when the image is loaded rather than when the document is ready?
|
|
|
|
$(".topic_list img").each(function(){
|
|
|
|
let aspectRatio = this.naturalHeight / this.naturalWidth;
|
|
|
|
console.log("aspectRatio ",aspectRatio);
|
|
|
|
console.log("this.height ",this.naturalHeight);
|
|
|
|
console.log("this.width ",this.naturalWidth);
|
|
|
|
|
|
|
|
$(this).css({
|
|
|
|
height: aspectRatio * this.width
|
|
|
|
});
|
|
|
|
});
|
2019-03-24 07:23:38 +00:00
|
|
|
});
|
|
|
|
})();
|