Commit 15c682fc authored by Robert Schilling's avatar Robert Schilling

Disable 'Save changes' button if input is empty, fixes #6351

parent d4f5af82
...@@ -321,7 +321,9 @@ class Notes ...@@ -321,7 +321,9 @@ class Notes
GitLab.GfmAutoComplete.setup() GitLab.GfmAutoComplete.setup()
form = note.find(".note-edit-form") form = note.find(".note-edit-form")
form.show() 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 Called in response to clicking the edit note link
......
...@@ -38,10 +38,10 @@ ...@@ -38,10 +38,10 @@
= f.text_area :note, class: 'note_text js-note-text js-gfm-input turn-on' = f.text_area :note, class: 'note_text js-note-text js-gfm-input turn-on'
.form-actions.clearfix .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 .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 %i.icon-paper-clip
%span Choose File ... %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