From 058aa842d48fcb3bc75de9c1347a44bf2088d5f9 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Thu, 30 Jan 2014 12:17:32 -0600 Subject: [PATCH] Ensure images, when initially dropped, have a width --- js/redactor-osticket.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js index 337d525a5..09629a041 100644 --- a/js/redactor-osticket.js +++ b/js/redactor-osticket.js @@ -126,8 +126,9 @@ $(function() { // TODO: Rewrite the entire <img> tag. Otherwise the @width // and @height attributes will begin to accumulate before = img.outerHTML; - $(img).attr('width', img.clientWidth) - .attr('height',img.clientHeight); + if (img.clientWidth && img.clientHeight) + $(img).attr('width', img.clientWidth) + .attr('height',img.clientHeight); html = html.replace(before, img.outerHTML); }); // Drop <inline> elements if found in the text (shady mojo happening -- GitLab