Skip to content
Snippets Groups Projects
Commit e47b8e77 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Fix links in toots opening the toot at first

parent 80cefd5b
No related branches found
No related tags found
No related merge requests found
......@@ -31,8 +31,6 @@ const StatusContent = React.createClass({
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener');
}
link.addEventListener('click', this.onNormalClick, false);
}
},
......@@ -52,10 +50,6 @@ const StatusContent = React.createClass({
}
},
onNormalClick (e) {
e.stopPropagation();
},
handleMouseDown (e) {
this.startXY = [e.clientX, e.clientY];
},
......@@ -64,6 +58,10 @@ const StatusContent = React.createClass({
const [ startX, startY ] = this.startXY;
const [ deltaX, deltaY ] = [Math.abs(e.clientX - startX), Math.abs(e.clientY - startY)];
if (e.target.localName === 'a' || (e.target.parentNode && e.target.parentNode.localName === 'a')) {
return;
}
if (deltaX + deltaY < 5) {
this.props.onClick();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment