closest can returns itself as well

This commit is contained in:
taehoon 2019-07-23 20:59:37 -04:00
parent 17ad5bbdf9
commit 1cefaa8446

View file

@ -322,8 +322,7 @@ const Status = {
this.error = undefined this.error = undefined
}, },
linkClicked (event) { linkClicked (event) {
let { target } = event const target = event.target.closest('.status-content a')
target = target.tagName === 'A' ? target : target.closest('.status-content a')
if (target) { if (target) {
if (target.className.match(/mention/)) { if (target.className.match(/mention/)) {
const href = target.href const href = target.href