gosora/themes/shadow/public/misc.js
Azareal e814e85daa fix alerts erroring when you don't have any
reset mod floater status on page bind
alias console.log with log
reduce boilerplate
2020-07-23 14:02:16 +10:00

13 lines
395 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;
log("aspectRatio",aspectRatio);
log("height",this.naturalHeight);
log("width",this.naturalWidth);
$(this).css({ height: aspectRatio * this.width });
});
});
})()