fix zero width for cached images in firefox

refs CNVS-47040

test plan:
- create a wiki page with an image
- save it
- load the page with cache disabled
- load the page with cache enabled
- both should show the image

Change-Id: I20725690030942b3225b227c097465e61b098789
Reviewed-on: https://gerrit.instructure.com/210893
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
This commit is contained in:
Brent Burgoyne 2019-09-24 18:56:09 -06:00
parent 0ee08a4af0
commit 43d2912363
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ function handleYoutubeLink () {
.each(function() {
var $this = $(this);
$this.find("img").each((i, img) => {
const handleWidth = () => $(img).css('maxWidth', Math.min($content.width(), $this.width(), $(img).width()));
const handleWidth = () => $(img).css('maxWidth', Math.min($content.width(), $this.width(), $(img).width() || img.naturalWidth));
if (img.naturalWidth === 0) {
img.addEventListener('load', handleWidth);
} else {