try to use the closest a tag as target

This commit is contained in:
taehoon 2019-07-23 15:43:03 -04:00
parent e448950023
commit 09efcb48a4

View File

@ -323,10 +323,8 @@ const Status = {
}, },
linkClicked (event) { linkClicked (event) {
let { target } = event let { target } = event
if (target.tagName === 'SPAN') { target = target.tagName === 'A' ? target : target.closest('a')
target = target.parentNode if (target) {
}
if (target.tagName === 'A') {
if (target.className.match(/mention/)) { if (target.className.match(/mention/)) {
const href = target.href const href = target.href
const attn = this.status.attentions.find(attn => mentionMatchesUrl(attn, href)) const attn = this.status.attentions.find(attn => mentionMatchesUrl(attn, href))