gosora/themes/tempra_simple/public/misc.js
Azareal d43bffdec5 experiment with ajax load for topic
track route perf for BadRoute
2020-03-11 13:26:33 +10:00

13 lines
419 B
JavaScript

(() => {
addInitHook("end_init", () => {
// 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("height",this.naturalHeight);
console.log("width",this.naturalWidth);
$(this).css({ height: aspectRatio * this.width });
});
});
})()