From 2f9e3fcaeaad1e35c19de23281800361b6945f60 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 23 Jul 2015 20:07:34 -0700 Subject: [PATCH] Make images be normal hyperlinks if middle/command clicked --- skins/base/views/molecules/MImageTile.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/skins/base/views/molecules/MImageTile.js b/skins/base/views/molecules/MImageTile.js index 4b581e383a..b35de04fa8 100644 --- a/skins/base/views/molecules/MImageTile.js +++ b/skins/base/views/molecules/MImageTile.js @@ -53,14 +53,17 @@ module.exports = React.createClass({ }, onClick: function(ev) { - ev.preventDefault(); - var content = this.props.mxEvent.getContent(); - var httpUrl = MatrixClientPeg.get().mxcUrlToHttp(content.url); - Modal.createDialog(ImageView, { - src: httpUrl, - width: content.info.w, - height: content.info.h - }); + 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); + Modal.createDialog(ImageView, { + src: httpUrl, + width: content.info.w, + height: content.info.h + }); + } }, render: function() { @@ -75,7 +78,7 @@ module.exports = React.createClass({ return ( - + {content.body}