mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 10:40:01 -03:30
Copy viewBox from symbol rather than hardcoding
This commit is contained in:
@@ -12,10 +12,15 @@ export default function() {
|
||||
// element's svg tag
|
||||
var content = $(iconPath).clone();
|
||||
|
||||
// Copy classes off the <symbol> so that we preserve any styling
|
||||
// Copy classes & viewBox off the <symbol> so that we preserve any styling
|
||||
// when we copy the item inline
|
||||
var classes = $(iconPath).attr('class');
|
||||
|
||||
// viewBox needs to be access via native
|
||||
// javascript's setAttribute function
|
||||
var viewBox = $(iconPath)[0].getAttribute('viewBox');
|
||||
|
||||
svg[0].setAttribute('viewBox', viewBox);
|
||||
svg.attr('class', classes)
|
||||
.html(content.contents());
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 55 42" width="100%" height="100%">
|
||||
<svg preserveAspectRatio="xMidYMid meet" width="100%" height="100%">
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 76 B |
Reference in New Issue
Block a user