Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/components/views/elements/TintableSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -71,9 +67,11 @@ 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 }
/>
);
}
});

module.exports = TintableSvg;
module.exports = TintableSvg;