Commit 20dbc2a1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #7425 from Razer6/remove_dup_javascript

Remove duplicated setupNoteForm method
parents a28fe934 010ba5ec
......@@ -406,30 +406,6 @@ class Notes
form.find(".js-note-text").focus()
form.addClass "js-discussion-note-form"
###
General note form setup.
deactivates the submit button when text is empty
hides the preview button when text is empty
setup GFM auto complete
show the form
###
setupNoteForm: (form) =>
disableButtonIfEmptyField form.find(".js-note-text"), form.find(".js-comment-button")
form.removeClass "js-new-note-form"
form.removeClass "js-new-note-form"
GitLab.GfmAutoComplete.setup()
# setup preview buttons
previewButton = form.find(".js-note-preview-button")
form.find(".js-note-text").on "input", ->
if $(this).val().trim() isnt ""
previewButton.removeClass("turn-off").addClass "turn-on"
else
previewButton.removeClass("turn-on").addClass "turn-off"
form.show()
###
Called when clicking on the "add a comment" button on the side of a diff line.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment