From e44bea6acce0ad8a47bfd6f58205b71b1995600a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Fri, 9 Aug 2013 15:32:22 +0200 Subject: [PATCH] SONAR-4450 Disable submit button when the issue comment value is blank --- .../WEB-INF/app/views/issue/_comment_form.html.erb | 8 ++++++-- .../WEB-INF/app/views/issue/_edit_comment_form.html.erb | 9 +++++++-- sonar-server/src/main/webapp/javascripts/issue.js | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_comment_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_comment_form.html.erb index bf24b487672..6b936b5dc37 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_comment_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_comment_form.html.erb @@ -4,12 +4,16 @@ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_edit_comment_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_edit_comment_form.html.erb index 05a94ef9d7d..0edd80784cb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_edit_comment_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_edit_comment_form.html.erb @@ -3,13 +3,18 @@
- +
- +  <%= link_to_function message('cancel'), 'closeIssueForm(this)' -%> 
diff --git a/sonar-server/src/main/webapp/javascripts/issue.js b/sonar-server/src/main/webapp/javascripts/issue.js index 02818576dac..9b4d85f5813 100644 --- a/sonar-server/src/main/webapp/javascripts/issue.js +++ b/sonar-server/src/main/webapp/javascripts/issue.js @@ -44,6 +44,7 @@ function submitIssueForm(elt) { formElt.find('.loading').removeClass('hidden'); formElt.find(':submit').prop('disabled', true); var issueElt = formElt.closest('[data-issue-key]'); + var issueKey = issueElt.attr('data-issue-key'); $j.ajax({ type: "POST", -- 2.39.5
- +
+ onclick="doEditIssueComment(this);return false" id="submit-comment">  <%= link_to_function message('cancel'), 'refreshIssue(this)' -%>