Skip to content

Commit

Permalink
Improve support for IE 11
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefJezek committed Mar 20, 2019
1 parent d3eae62 commit 0e86ab6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iron-iconset-svg.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,12 @@
}

content.removeAttribute('id');
content = content.outerHTML.replace(/id="/g, 'id="' + sourceId + '-')
.replace(/fill="url\(#/g, 'fill="url(#' + sourceId + '-');

// IE 11 does not provide the outerHTML property.
var outer = content.outerHTML || new XMLSerializer().serializeToString(content);

content = outer.replace(/id="/g, 'id="' + sourceId + '-')
.replace(/fill="url\(#/g, 'fill="url(#' + sourceId + '-');

svg.setAttribute('viewBox', viewBox);
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
Expand Down

0 comments on commit 0e86ab6

Please sign in to comment.