summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-12 18:06:52 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-12 18:06:52 -0300
commit6a238c37e002c9d8dcc51af2cb3dff44c900139c (patch)
treee014491076f1270e079195c64206a68d87e3dbc7
parent2505dc46e7fa34fc874a35691385bc8f3e56837e (diff)
downloadgitlab-ce-fix-todo-target-path.tar.gz
Fix todo_target_path for todos where target was removedfix-todo-target-path
-rw-r--r--app/assets/javascripts/todos.js.coffee2
-rw-r--r--app/helpers/todos_helper.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/todos.js.coffee b/app/assets/javascripts/todos.js.coffee
index 886da72e261..00d2b641723 100644
--- a/app/assets/javascripts/todos.js.coffee
+++ b/app/assets/javascripts/todos.js.coffee
@@ -59,6 +59,8 @@ class @Todos
goToTodoUrl: (e)->
todoLink = $(this).data('url')
+ return unless todoLink
+
if e.metaKey
e.preventDefault()
window.open(todoLink,'_blank')
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index edc5686cf08..2f066682180 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -20,6 +20,8 @@ module TodosHelper
end
def todo_target_path(todo)
+ return unless todo.target.present?
+
anchor = dom_id(todo.note) if todo.note.present?
if todo.for_commit?