diff options
author | Phil Hughes <me@iamphill.com> | 2017-09-12 15:38:42 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-12 15:39:08 +0100 |
commit | 855c258fdbceb1e2f19f096da755b9741122d628 (patch) | |
tree | 89d03f749b9d977c59a047fb2559ffa0d0a76827 /app/assets | |
parent | 08362d80b8dc915c0812c32df5f8505c26b19b53 (diff) | |
download | gitlab-ce-855c258fdbceb1e2f19f096da755b9741122d628.tar.gz |
fixed todos spec
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/todos.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/app/assets/javascripts/todos.js b/app/assets/javascripts/todos.js index 3dc0c3f8d43..2fffe09c74e 100644 --- a/app/assets/javascripts/todos.js +++ b/app/assets/javascripts/todos.js @@ -138,22 +138,17 @@ export default class Todos { goToTodoUrl(e) { const todoLink = this.dataset.url; - if (!todoLink) { + if (!todoLink || e.target.tagName === 'A' || e.target.tagName === 'IMG') { return; } + e.stopPropagation(); + e.preventDefault(); + if (isMetaClick(e)) { const windowTarget = '_blank'; - const selected = e.target; - e.stopPropagation(); - e.preventDefault(); - - if (selected.tagName === 'IMG') { - const avatarUrl = selected.parentElement.getAttribute('href'); - window.open(avatarUrl, windowTarget); - } else { - window.open(todoLink, windowTarget); - } + + window.open(todoLink, windowTarget); } else { gl.utils.visitUrl(todoLink); } |