Skip to content

Commit e870e34

Browse files
committed
fix rendering of logo in IE
1 parent 3795223 commit e870e34

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/components/modebar/modebar.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,14 @@ proto.createIcon = function(thisIcon) {
188188
Number(thisIcon.height) :
189189
thisIcon.ascent - thisIcon.descent,
190190
svgNS = 'http://www.w3.org/2000/svg',
191-
icon = document.createElementNS(svgNS, 'svg');
192-
193-
icon.setAttribute('height', '1em');
194-
icon.setAttribute('width', (thisIcon.width / iconHeight) + 'em');
195-
icon.setAttribute('viewBox', [0, 0, thisIcon.width, iconHeight].join(' '));
191+
icon;
196192

197193
if(thisIcon.path) {
194+
icon = document.createElementNS(svgNS, 'svg');
195+
icon.setAttribute('height', '1em');
196+
icon.setAttribute('width', (thisIcon.width / iconHeight) + 'em');
197+
icon.setAttribute('viewBox', [0, 0, thisIcon.width, iconHeight].join(' '));
198+
198199
var path = document.createElementNS(svgNS, 'path');
199200
path.setAttribute('d', thisIcon.path);
200201

@@ -214,9 +215,12 @@ proto.createIcon = function(thisIcon) {
214215
}
215216

216217
if(thisIcon.svg) {
217-
icon.innerHTML = thisIcon.svg;
218+
icon = document.createElement('div');
219+
icon.innerHTML = '<svg height="1em" width="' + (thisIcon.width / iconHeight) + 'em" viewbox="0, 0, ' + thisIcon.width + ',' + thisIcon.height + '" xmlns="">' + thisIcon.svg + '</svg>';
218220
}
219221

222+
223+
220224
return icon;
221225
};
222226

0 commit comments

Comments
 (0)