Commit 91d6f916 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #7432 from Razer6/disable_comment_btn_if_empty

Disable 'Save changes' button if input is empty, fixes #6351
parents d4b17700 15c682fc
......@@ -321,7 +321,9 @@ class Notes
GitLab.GfmAutoComplete.setup()
form = note.find(".note-edit-form")
form.show()
form.find("textarea").focus()
textarea = form.find("textarea")
textarea.focus()
disableButtonIfEmptyField textarea, form.find(".js-comment-button")
###
Called in response to clicking the edit note link
......
......@@ -38,10 +38,10 @@
= f.text_area :note, class: 'note_text js-note-text js-gfm-input turn-on'
.form-actions.clearfix
= f.submit 'Save changes', class: "btn btn-primary btn-save"
= f.submit 'Save changes', class: "btn btn-primary btn-save js-comment-button"
.note-form-option
%a.choose-btn.btn.btn-small.js-choose-note-attachment-button
%a.choose-btn.btn.js-choose-note-attachment-button
%i.icon-paper-clip
%span Choose File ...
 
......
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