Skip to content

Commit

Permalink
Forced clear hashtag at end of URL
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLu1997 committed May 26, 2016
1 parent e81fa32 commit c0c43a2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions webapp/components/file_attachment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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'
>
Expand All @@ -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>
Expand Down

0 comments on commit c0c43a2

Please sign in to comment.