);
@@ -1342,7 +1343,7 @@ module.exports = React.createClass({
{ videoMuteButton }
{ zoomButton }
{ statusBar }
-
+
}
diff --git a/src/components/views/elements/TintableSvg.js b/src/components/views/elements/TintableSvg.js
new file mode 100644
index 0000000000..a4b66d8114
--- /dev/null
+++ b/src/components/views/elements/TintableSvg.js
@@ -0,0 +1,56 @@
+/*
+Copyright 2015 OpenMarket Ltd
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+'use strict';
+
+var React = require('react');
+var ReactDOM = require("react-dom");
+var dis = require("../../../dispatcher");
+
+module.exports = React.createClass({
+ displayName: 'TintableSvg',
+
+ propTypes: {
+ src: React.PropTypes.string.isRequired,
+ width: React.PropTypes.string.isRequired,
+ height: React.PropTypes.string.isRequired,
+ className: React.PropTypes.string,
+ },
+
+ componentDidMount: function() {
+ // 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() {
+ ReactDOM.findDOMNode(this).removeEventListener('load', this.onLoad);
+ },
+
+ onLoad: function(event) {
+ dis.dispatch({ action: "svg_onload", svg: event.target });
+ },
+
+ render: function() {
+ return (
+
+ );
+ }
+});
diff --git a/src/components/views/messages/MFileBody.js b/src/components/views/messages/MFileBody.js
index 7d6cd3d557..a2dcfc3ff2 100644
--- a/src/components/views/messages/MFileBody.js
+++ b/src/components/views/messages/MFileBody.js
@@ -19,6 +19,7 @@ limitations under the License.
var React = require('react');
var filesize = require('filesize');
var MatrixClientPeg = require('../../../MatrixClientPeg');
+var sdk = require('../../../index');
var dis = require("../../../dispatcher");
module.exports = React.createClass({
@@ -57,12 +58,14 @@ module.exports = React.createClass({
var httpUrl = cli.mxcUrlToHttp(content.url);
var text = this.presentableTextForFile(content);
+ var TintableSvg = sdk.getComponent("elements.TintableSvg");
+
if (httpUrl) {
return (