Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support bg-position for each linear-gradient in IE9

  • Loading branch information...
commit 280945ab92c44e429b0a0567fb2a2b4c63ddf774 1 parent 8aa170f
Jason Johnston authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 sources/IE9BackgroundRenderer.js
View
9 sources/IE9BackgroundRenderer.js
@@ -28,7 +28,8 @@ PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( {
if ( images ) {
while( img = images[ i++ ] ) {
bg.push( img.imgType === 'linear-gradient' ?
- 'url(data:image/svg+xml,' + escape( this.getGradientSvg( img ) ) + ') ' + ( img.imgRepeat || '' ) :
+ 'url(data:image/svg+xml,' + escape( this.getGradientSvg( img ) ) + ') ' +
+ ( img.imgRepeat || '' ) + ' ' + this.bgPositionToString( img.bgPosition ) :
img.origString
);
}
@@ -42,6 +43,12 @@ PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( {
}
},
+ bgPositionToString: function( bgPosition ) {
+ return bgPosition ? bgPosition.tokens.map(function(token) {
+ return token.tokenValue;
+ }).join(' ') : '';
+ },
+
getGradientSvg: function( info ) {
var el = this.targetElement,
bounds = this.boundsInfo.getBounds(),
Please sign in to comment.
Something went wrong with that request. Please try again.