@@ -188,13 +188,14 @@ proto.createIcon = function(thisIcon) {
188
188
Number ( thisIcon . height ) :
189
189
thisIcon . ascent - thisIcon . descent ,
190
190
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 ;
196
192
197
193
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
+
198
199
var path = document . createElementNS ( svgNS , 'path' ) ;
199
200
path . setAttribute ( 'd' , thisIcon . path ) ;
200
201
@@ -214,9 +215,12 @@ proto.createIcon = function(thisIcon) {
214
215
}
215
216
216
217
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>' ;
218
220
}
219
221
222
+
223
+
220
224
return icon ;
221
225
} ;
222
226
0 commit comments