Merge pull request #274 from matrix-org/rav/drop_onload_workaround

Drop workaround for object.onLoad
pull/21833/head
Richard van der Hoff 2016-04-18 14:12:51 +01:00
commit 8e1b0ee0a9
1 changed files with 4 additions and 6 deletions

View File

@ -43,14 +43,10 @@ var TintableSvg = React.createClass({
componentDidMount: function() {
this.id = TintableSvg.idSequence++;
TintableSvg.mounts[this.id] = this;
// we can't use onLoad on object due to https://github.com/facebook/react/pull/5781
// so handle it with pure DOM instead
ReactDOM.findDOMNode(this).addEventListener('load', this.onLoad);
},
componentWillUnmount: function() {
delete TintableSvg.mounts[this.id];
ReactDOM.findDOMNode(this).removeEventListener('load', this.onLoad);
},
tint: function() {
@ -71,7 +67,9 @@ var TintableSvg = React.createClass({
type="image/svg+xml"
data={ this.props.src }
width={ this.props.width }
height={ this.props.height }/>
height={ this.props.height }
onLoad={ this.onLoad }
/>
);
}
});