Remove click handlers etc.
parent
1c8586e802
commit
d652f117fb
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MFileBody from './MFileBody';
|
|
||||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
import ImageUtils from '../../../ImageUtils';
|
import ImageUtils from '../../../ImageUtils';
|
||||||
import Modal from '../../../Modal';
|
import Modal from '../../../Modal';
|
||||||
|
@ -48,29 +47,6 @@ module.exports = React.createClass({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
onClick: function onClick(ev) {
|
|
||||||
if (ev.button == 0 && !ev.metaKey) {
|
|
||||||
ev.preventDefault();
|
|
||||||
const content = this.props.mxEvent.getContent();
|
|
||||||
const httpUrl = this._getContentUrl();
|
|
||||||
const ImageView = sdk.getComponent("elements.ImageView");
|
|
||||||
const params = {
|
|
||||||
src: httpUrl,
|
|
||||||
name: content.body && content.body.length > 0 ? content.body : _t('Attachment'),
|
|
||||||
mxEvent: this.props.mxEvent,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (content.info) {
|
|
||||||
params.width = content.info.w;
|
|
||||||
params.height = content.info.h;
|
|
||||||
params.fileSize = content.info.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_isGif: function() {
|
_isGif: function() {
|
||||||
const content = this.props.mxEvent.getContent();
|
const content = this.props.mxEvent.getContent();
|
||||||
return (
|
return (
|
||||||
|
@ -185,7 +161,6 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
|
||||||
const content = this.props.mxEvent.getContent();
|
const content = this.props.mxEvent.getContent();
|
||||||
|
|
||||||
if (this.state.error !== null) {
|
if (this.state.error !== null) {
|
||||||
|
@ -227,13 +202,11 @@ module.exports = React.createClass({
|
||||||
if (thumbUrl) {
|
if (thumbUrl) {
|
||||||
return (
|
return (
|
||||||
<span className="mx_MImageBody" ref="body">
|
<span className="mx_MImageBody" ref="body">
|
||||||
<a href={contentUrl} onClick={this.onClick}>
|
<img className="mx_MImageBody_thumbnail" src={thumbUrl} ref="image"
|
||||||
<img className="mx_MImageBody_thumbnail" src={thumbUrl} ref="image"
|
alt={content.body}
|
||||||
alt={content.body}
|
onLoad={this.props.onWidgetLoad}
|
||||||
onLoad={this.props.onWidgetLoad}
|
onMouseEnter={this.onImageEnter}
|
||||||
onMouseEnter={this.onImageEnter}
|
onMouseLeave={this.onImageLeave} />
|
||||||
onMouseLeave={this.onImageLeave} />
|
|
||||||
</a>
|
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
} else if (content.body) {
|
} else if (content.body) {
|
||||||
|
|
Loading…
Reference in New Issue