patternity
Advanced tools
Comparing version 1.0.34 to 1.0.35
@@ -70,8 +70,11 @@ var React = require('react'); | ||
var image = React.findDOMNode(this.refs.image); | ||
image.onload = this._optimizeImageVisibility; | ||
var self = this; | ||
image.onload = function(event) { | ||
var image = event ? event.target : this; //IE8 doesn't get the proper event target | ||
self._optimizeImageVisibility(image); | ||
}; | ||
}, | ||
_optimizeImageVisibility : function (event) { | ||
_optimizeImageVisibility : function (image) { | ||
this._hideLoading(); | ||
var image = event.target; | ||
@@ -105,7 +108,7 @@ if(image.naturalWidth > image.naturalHeight){ | ||
_optomizeForWidth: function(image){ | ||
this._updateImageStyling(image, '100%', 'initial', 'middle'); | ||
this._updateImageStyling(image, '100%', 'auto', 'middle'); | ||
}, | ||
_optimizeForHeight: function(image){ | ||
this._updateImageStyling(image, 'initial', '100%', 'initial'); | ||
this._updateImageStyling(image, 'auto', '100%', 'top'); | ||
}, | ||
@@ -115,12 +118,12 @@ | ||
image.style.height = height; | ||
image.style.width = width; | ||
this._updateVerticalAlign(image, verticalAlign); | ||
image.style.verticalAlign = verticalAlign; | ||
this._updateWidth(image, width); | ||
$(image).addClass('loaded'); | ||
}, | ||
_updateVerticalAlign : function (image, verticalAlign) { | ||
_updateWidth : function (image, width) { | ||
if(this._imageIsNotAspectRatio(image)) { | ||
image.style.verticalAlign = verticalAlign; | ||
image.style.width = width; | ||
} else { | ||
image.style.verticalAlign = 'initial'; | ||
image.style.width = '100%'; | ||
} | ||
@@ -127,0 +130,0 @@ }, |
{ | ||
"name": "patternity", | ||
"version": "1.0.34", | ||
"version": "1.0.35", | ||
"description": "Patternity is the pattern library and style guide for all Influitive apps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2910779
27899