Unverified Commit f4372c3f by Braden MacDonald Committed by GitHub

Merge pull request #142 from open-craft/josh/fix-ie11

Fixes failure when loading background image on IE11
parents 17c63ea0 1db177ad
......@@ -988,6 +988,14 @@ function DragAndDropBlock(runtime, element, configuration) {
var promise = $.Deferred();
var img = new Image();
img.addEventListener("load", function() {
if (img.width == 0 || img.height == 0) {
// Workaround for IE11 issue with SVG images
document.body.appendChild(img);
var width = img.offsetWidth;
var height = img.offsetHeight;
document.body.removeChild(img);
img.width = width, img.height = height;
}
if (img.width > 0 && img.height > 0) {
promise.resolve(img);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment