diff --git a/awx/ui/static/js/shared/icon/icon.directive.js b/awx/ui/static/js/shared/icon/icon.directive.js index 689388dd2e..b0735704fb 100644 --- a/awx/ui/static/js/shared/icon/icon.directive.js +++ b/awx/ui/static/js/shared/icon/icon.directive.js @@ -12,10 +12,15 @@ export default function() { // element's svg tag var content = $(iconPath).clone(); - // Copy classes off the so that we preserve any styling + // Copy classes & viewBox off the 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()); diff --git a/awx/ui/static/js/shared/icon/icon.partial.html b/awx/ui/static/js/shared/icon/icon.partial.html index fa24d3450e..0bd01fdf31 100644 --- a/awx/ui/static/js/shared/icon/icon.partial.html +++ b/awx/ui/static/js/shared/icon/icon.partial.html @@ -1,2 +1,2 @@ - +