aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-05-06 10:16:05 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-05-06 10:16:05 +0200
commitcbea221c569d0edcd18f311a004e5e2dca80af51 (patch)
tree5d4b33516ddb1c975a396470b3c4cb0bf8008eec
parenta66c02e1b0259330364f9b73fb40867e8008ea70 (diff)
downloadsonarqube-cbea221c569d0edcd18f311a004e5e2dca80af51.tar.gz
sonarqube-cbea221c569d0edcd18f311a004e5e2dca80af51.zip
SONAR-1973 Fix bug on submit button
If two reviews or false-positive were edited at the same time, the submit buttons would not behave correctly as they had the same name.
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_false_positive_form.html.erb4
2 files changed, 4 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb
index d045ad90c28..fbdd6635866 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb
@@ -10,9 +10,9 @@
<table class="width100">
<tr>
<td style="vertical-align:top">
- <textarea id="commentText<%= params[:id] -%>" rows="8" name="text" style="width: 100%" onkeyup="if (this.value=='') $('submit_btn').disabled='true'; else $('submit_btn').disabled='';"><%= @comment.text if @comment -%></textarea>
+ <textarea id="commentText<%= params[:id] -%>" rows="8" name="text" style="width: 100%" onkeyup="if (this.value=='') $('submit_btn<%= params[:id] -%>').disabled='true'; else $('submit_btn<%= params[:id] -%>').disabled='';"><%= @comment.text if @comment -%></textarea>
<br/>
- <%= submit_to_remote "submit_btn", button, :url => { :action => 'violation_save_comment'}, :html => { :id => "submit_btn", :disabled => "true" }, :update => 'vId'+params[:id] -%>
+ <%= submit_to_remote "submit_btn"+params[:id] , button, :url => { :action => 'violation_save_comment'}, :html => { :id => "submit_btn"+params[:id], :disabled => "true" }, :update => 'vId'+params[:id] -%>
&nbsp;
<%= link_to_remote 'Cancel', :url => {:action => 'display_violation', :id => params[:id]}, :update => 'vId' + params[:id] -%>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_false_positive_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_false_positive_form.html.erb
index e78ea5e7dd8..d11e374e1e5 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_false_positive_form.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_false_positive_form.html.erb
@@ -13,8 +13,8 @@
<input type="hidden" name="false_positive" value="true"/>
<% end %>
<h3><%= title -%></h3>
- <textarea id="commentText<%= params[:id] -%>" rows="8" name="comment" style="width: 100%" onkeyup="if (this.value=='') $('submit_btn').disabled='true'; else $('submit_btn').disabled='';"></textarea>
- <%= submit_to_remote "submit_btn", button, :url => { :action => 'violation_flag_as_false_positive' }, :html => { :id => "submit_btn", :disabled => "true" }, :update => 'vId'+params[:id] -%>
+ <textarea id="commentText<%= params[:id] -%>" rows="8" name="comment" style="width: 100%" onkeyup="if (this.value=='') $('submit_btn<%= params[:id] -%>').disabled='true'; else $('submit_btn<%= params[:id] -%>').disabled='';"></textarea>
+ <%= submit_to_remote "submit_btn"+params[:id], button, :url => { :action => 'violation_flag_as_false_positive' }, :html => { :id => "submit_btn"+params[:id], :disabled => "true" }, :update => 'vId'+params[:id] -%>
&nbsp;
<%= link_to_remote 'Cancel', :url => {:action => 'display_violation', :id => params[:id]}, :update => 'vId' + params[:id] -%>
</form>