Forced clear hashtag at end of URL (#3128)

Этот коммит содержится в:
David Lu
2016-05-26 11:44:40 -07:00
коммит произвёл Joram Wilander
родитель 934ff34ccb
Коммит 4aa0465c73

Просмотреть файл

@@ -25,6 +25,7 @@ class FileAttachment extends React.Component {
this.loadFiles = this.loadFiles.bind(this); this.loadFiles = this.loadFiles.bind(this);
this.addBackgroundImage = this.addBackgroundImage.bind(this); this.addBackgroundImage = this.addBackgroundImage.bind(this);
this.onAttachmentClick = this.onAttachmentClick.bind(this);
this.canSetState = false; this.canSetState = false;
this.state = {fileSize: -1}; this.state = {fileSize: -1};
@@ -127,6 +128,10 @@ class FileAttachment extends React.Component {
$(ReactDOM.findDOMNode(this.refs[name])).css('background-image', 'initial'); $(ReactDOM.findDOMNode(this.refs[name])).css('background-image', 'initial');
} }
} }
onAttachmentClick(e) {
e.preventDefault();
this.props.handleImageClick(this.props.index);
}
render() { render() {
var filename = this.props.filename; var filename = this.props.filename;
@@ -197,7 +202,7 @@ class FileAttachment extends React.Component {
> >
<a <a
href='#' href='#'
onClick={() => this.props.handleImageClick(this.props.index)} onClick={this.onAttachmentClick}
className='post-image__name' className='post-image__name'
rel='noopener noreferrer' rel='noopener noreferrer'
> >
@@ -215,7 +220,7 @@ class FileAttachment extends React.Component {
<a <a
className='post-image__thumbnail' className='post-image__thumbnail'
href='#' href='#'
onClick={() => this.props.handleImageClick(this.props.index)} onClick={this.onAttachmentClick}
> >
{thumbnail} {thumbnail}
</a> </a>