summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-03-30 20:11:41 +0100
committerPhil Hughes <me@iamphill.com>2016-04-04 10:48:49 +0100
commit1f5083343081adb6e4a9a438600163844d2e9875 (patch)
tree9f6352f9d751661ca50c165c6b35f4591444a85f /app
parentccc64676a97d251658190bfb62e97b166cee4db1 (diff)
downloadgitlab-ce-1f5083343081adb6e4a9a438600163844d2e9875.tar.gz
Updated tests
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes.js.coffee14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index 0ee1e70da2c..35547adf8a4 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -65,6 +65,8 @@ class @Notes
# add diff note
$(document).on "click", ".js-add-diff-note-button", @addDiffNote
+ $(document).on "mouseover", ".js-add-diff-note-button", ->
+ console.log $(this).data('line-code')
# hide diff note form
$(document).on "click", ".js-close-discussion-note-form", @cancelDiscussionForm
@@ -264,6 +266,8 @@ class @Notes
form.removeClass "js-new-note-form"
form.addClass "js-main-target-form"
+ form.find("#note_line_code").remove()
+
###
General note form setup.
@@ -500,8 +504,9 @@ class @Notes
###
addDiffNote: (e) =>
e.preventDefault()
- link = e.currentTarget
- row = $(link).closest("tr")
+ $link = $(e.currentTarget)
+ console.log $link.data('line-code')
+ row = $link.closest("tr")
nextRow = row.next()
hasNotes = nextRow.is(".notes_holder")
addForm = false
@@ -510,7 +515,7 @@ class @Notes
# In parallel view, look inside the correct left/right pane
if @isParallelView()
- lineType = $(link).data("lineType")
+ lineType = $link.data("lineType")
targetContent += "." + lineType
rowCssToAdd = "<tr class=\"notes_holder js-temp-notes-holder\"><td class=\"notes_line\"></td><td class=\"notes_content parallel old\"></td><td class=\"notes_line\"></td><td class=\"notes_content parallel new\"></td></tr>"
@@ -536,7 +541,7 @@ class @Notes
newForm.appendTo row.next().find(targetContent)
# show the form
- @setupDiscussionNoteForm $(link), newForm
+ @setupDiscussionNoteForm $link, newForm
###
Called in response to "cancel" on a diff note form.
@@ -561,7 +566,6 @@ class @Notes
cancelDiscussionForm: (e) =>
e.preventDefault()
- form = $(".js-new-note-form")
form = $(e.target).closest(".js-discussion-note-form")
@removeDiscussionNoteForm(form)