|
104 | 104 | * @param {string} id Icon name/id used to register the iconset
|
105 | 105 | * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the
|
106 | 106 | * data or as part of the lookup in `$templateCache` if pre-loading was configured.
|
107 |
| - * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set. |
| 107 | + * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set. |
108 | 108 | * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.
|
109 | 109 | * Default value is 24.
|
110 | 110 | *
|
|
134 | 134 | *
|
135 | 135 | * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the
|
136 | 136 | * data or as part of the lookup in `$templateCache` if pre-loading was configured.
|
137 |
| - * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set. |
| 137 | + * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set. |
138 | 138 | * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.
|
139 | 139 | * Default value is 24.
|
140 | 140 | *
|
|
247 | 247 | config.defaultViewBoxSize = viewBoxSize;
|
248 | 248 | return this;
|
249 | 249 | },
|
250 |
| - |
| 250 | + |
251 | 251 | /**
|
252 | 252 | * Register an alias name associated with a font-icon library style ;
|
253 | 253 | */
|
|
422 | 422 | */
|
423 | 423 | function cacheIcon( id ) {
|
424 | 424 |
|
425 |
| - return function updateCache( icon ) { |
426 |
| - iconCache[id] = isIcon(icon) ? icon : new Icon(icon, config[id]); |
| 425 | + return function updateCache( _icon ) { |
| 426 | + var icon = isIcon(_icon) ? _icon : new Icon(_icon, config[id]); |
| 427 | + |
| 428 | + //clear id attributes to prevent aria issues |
| 429 | + var elem = icon.element; |
| 430 | + elem.removeAttribute('id'); |
| 431 | + |
| 432 | + angular.forEach(elem.querySelectorAll('[id]'), function(item) { |
| 433 | + item.removeAttribute('id'); |
| 434 | + }); |
| 435 | + |
| 436 | + iconCache[id] = icon; |
| 437 | + |
427 | 438 |
|
428 | 439 | return iconCache[id].clone();
|
429 | 440 | };
|
|
0 commit comments