File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ angular.module('angular-svg-round-progress')
8282 } ) ;
8383
8484 ring . css ( {
85- "stroke" : options . color ,
85+ "stroke" : service . resolveColor ( options . color ) ,
8686 "stroke-width" : stroke ,
8787 "stroke-linecap" : options . rounded ? "round" : "butt"
8888 } ) ;
@@ -98,7 +98,7 @@ angular.module('angular-svg-round-progress')
9898 "cy" : radius ,
9999 "r" : backgroundSize >= 0 ? backgroundSize : 0
100100 } ) . css ( {
101- "stroke" : options . bgcolor ,
101+ "stroke" : service . resolveColor ( options . bgcolor ) ,
102102 "stroke-width" : stroke
103103 } ) ;
104104 } ;
@@ -182,7 +182,7 @@ angular.module('angular-svg-round-progress')
182182 '<svg class="' + directiveName + '" xmlns="http://www.w3.org/2000/svg">' ,
183183 '<circle fill="none"/>' ,
184184 '<path fill="none"/>' ,
185- '<g ng-transclude width ></g>' ,
185+ '<g ng-transclude></g>' ,
186186 '</svg>'
187187 ] ;
188188
Original file line number Diff line number Diff line change 33angular . module ( 'angular-svg-round-progress' ) . service ( 'roundProgressService' , [ function ( ) {
44 var service = { } ;
55 var isNumber = angular . isNumber ;
6+ var base = document . head . querySelector ( 'base' ) ;
7+
8+ // fixes issues if the document has a <base> element
9+ service . resolveColor = base && base . href ? function ( value ) {
10+ var hashIndex = value . indexOf ( '#' ) ;
11+
12+ if ( hashIndex > - 1 && value . indexOf ( 'url' ) > - 1 ) {
13+ return value . slice ( 0 , hashIndex ) + window . location . href + value . slice ( hashIndex ) ;
14+ }
15+
16+ return value ;
17+ } : function ( value ) {
18+ return value ;
19+ } ;
620
721 // credits to http://modernizr.com/ for the feature test
822 service . isSupported = ! ! ( document . createElementNS && document . createElementNS ( 'http://www.w3.org/2000/svg' , "svg" ) . createSVGRect ) ;
You can’t perform that action at this time.
0 commit comments