hopefully fix vector-im/vector-web#475
This commit is contained in:
parent
8edfd60b64
commit
072130466c
1 changed files with 11 additions and 6 deletions
|
@ -48,18 +48,23 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onClick: function(ev) {
|
onClick: function onClick(ev) {
|
||||||
if (ev.button == 0 && !ev.metaKey) {
|
if (ev.button == 0 && !ev.metaKey) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
var content = this.props.mxEvent.getContent();
|
var content = this.props.mxEvent.getContent();
|
||||||
var httpUrl = MatrixClientPeg.get().mxcUrlToHttp(content.url);
|
var httpUrl = MatrixClientPeg.get().mxcUrlToHttp(content.url);
|
||||||
var ImageView = sdk.getComponent("elements.ImageView");
|
var ImageView = sdk.getComponent("elements.ImageView");
|
||||||
Modal.createDialog(ImageView, {
|
var params = {
|
||||||
src: httpUrl,
|
src: httpUrl,
|
||||||
width: content.info.w,
|
mxEvent: this.props.mxEvent
|
||||||
height: content.info.h,
|
};
|
||||||
mxEvent: this.props.mxEvent,
|
|
||||||
}, "mx_Dialog_lightbox");
|
if (content.info) {
|
||||||
|
params.width = content.info.w;
|
||||||
|
params.height = content.info.h;
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue