diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-24 18:51:09 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-24 18:51:09 +0100 |
commit | e47b8e778b21ff4bda4fac79a5935028127edb53 (patch) | |
tree | 7a5d9facf3b9266a4bf7c3243f07f5e8cb38db06 /app/assets | |
parent | 80cefd5b3cd9c8efa435f684a33fe1562696b74a (diff) |
Fix links in toots opening the toot at first
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/components/components/status_content.jsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx index 68224b7ba..1ee720c9b 100644 --- a/app/assets/javascripts/components/components/status_content.jsx +++ b/app/assets/javascripts/components/components/status_content.jsx @@ -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(); } |