summaryrefslogtreecommitdiffstats
path: root/webapp/components/file_attachment.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-05-26 11:44:40 -0700
committerJoram Wilander <jwawilander@gmail.com>2016-05-26 14:44:40 -0400
commit4aa0465c73e5bd9afb7eb67b1426969094617a2d (patch)
treeca7ff4ef8d8812e0c5684bf3a5d345241bd574e0 /webapp/components/file_attachment.jsx
parent934ff34ccb99641beb2bb1ea73bca836fadbdd1b (diff)
downloadchat-4aa0465c73e5bd9afb7eb67b1426969094617a2d.tar.gz
chat-4aa0465c73e5bd9afb7eb67b1426969094617a2d.tar.bz2
chat-4aa0465c73e5bd9afb7eb67b1426969094617a2d.zip
Forced clear hashtag at end of URL (#3128)
Diffstat (limited to 'webapp/components/file_attachment.jsx')
-rw-r--r--webapp/components/file_attachment.jsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/webapp/components/file_attachment.jsx b/webapp/components/file_attachment.jsx
index bbd42fc69..d5bbae4c9 100644
--- a/webapp/components/file_attachment.jsx
+++ b/webapp/components/file_attachment.jsx
@@ -25,6 +25,7 @@ class FileAttachment extends React.Component {
this.loadFiles = this.loadFiles.bind(this);
this.addBackgroundImage = this.addBackgroundImage.bind(this);
+ this.onAttachmentClick = this.onAttachmentClick.bind(this);
this.canSetState = false;
this.state = {fileSize: -1};
@@ -127,6 +128,10 @@ class FileAttachment extends React.Component {
$(ReactDOM.findDOMNode(this.refs[name])).css('background-image', 'initial');
}
}
+ onAttachmentClick(e) {
+ e.preventDefault();
+ this.props.handleImageClick(this.props.index);
+ }
render() {
var filename = this.props.filename;
@@ -197,7 +202,7 @@ class FileAttachment extends React.Component {
>
<a
href='#'
- onClick={() => this.props.handleImageClick(this.props.index)}
+ onClick={this.onAttachmentClick}
className='post-image__name'
rel='noopener noreferrer'
>
@@ -215,7 +220,7 @@ class FileAttachment extends React.Component {
<a
className='post-image__thumbnail'
href='#'
- onClick={() => this.props.handleImageClick(this.props.index)}
+ onClick={this.onAttachmentClick}
>
{thumbnail}
</a>