mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Make images be normal hyperlinks if middle/command clicked
This commit is contained in:
parent
33f2955927
commit
2f9e3fcaea
@ -53,6 +53,8 @@ module.exports = React.createClass({
|
||||
},
|
||||
|
||||
onClick: function(ev) {
|
||||
var ms = ev.getModifierState();
|
||||
if (ev.button == 0 && !ev.metaKey) {
|
||||
ev.preventDefault();
|
||||
var content = this.props.mxEvent.getContent();
|
||||
var httpUrl = MatrixClientPeg.get().mxcUrlToHttp(content.url);
|
||||
@ -61,6 +63,7 @@ module.exports = React.createClass({
|
||||
width: content.info.w,
|
||||
height: content.info.h
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
@ -75,7 +78,7 @@ module.exports = React.createClass({
|
||||
|
||||
return (
|
||||
<span className="mx_MImageTile">
|
||||
<a href="#" onClick={this.onClick}>
|
||||
<a href={cli.mxcUrlToHttp(content.url)} onClick={this.onClick}>
|
||||
<img src={cli.mxcUrlToHttp(content.url, 320, 240)} alt={content.body} style={imgStyle} />
|
||||
</a>
|
||||
</span>
|
||||
|
Loading…
Reference in New Issue
Block a user