Skip to content

Commit

Permalink
Fix IE rendering of SVG as overlay image fabricjs#2 - Fix coding synt…
Browse files Browse the repository at this point in the history
…ax (CI)
  • Loading branch information
WietseWind committed Sep 19, 2017
1 parent 9779796 commit df1527f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,17 @@
img.onload = function () {
// ugly fix for IE11; IE11 will only render data-url SVG if visible in DOM
// so we create a div (1x1px at -1,-1px) containing the img.
if(img.src.substr(0,5) == 'data:'){
if (img.src.substr(0,5) === 'data:') {
var div = document.createElement('div');
div.style.width = div.style.height = '1px';
div.style.left = div.style.right = '-1px';
div.style.position = 'absolute';
div.appendChild(img)
document.querySelector("body").appendChild(div)
div.appendChild(img);
document.querySelector('body').appendChild(div);
setTimeout(function(){
callback && callback.call(context, img);
div = img = img.onload = img.onerror = null;
}, 1)
}, 1);
} else {
callback && callback.call(context, img);
img = img.onload = img.onerror = null;
Expand Down

0 comments on commit df1527f

Please sign in to comment.