diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-06-04 16:27:06 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-06-04 16:28:49 +0200 |
commit | d60c6660d19f6a3ea2f6bd2b5d3dad87773c05d3 (patch) | |
tree | d1cfa75143c2417034653d213cd87eb1b9a9c416 /sonar-server/src/main | |
parent | 44ec4eaf690297a6320afea255b5130c25431a54 (diff) | |
download | sonarqube-d60c6660d19f6a3ea2f6bd2b5d3dad87773c05d3.tar.gz sonarqube-d60c6660d19f6a3ea2f6bd2b5d3dad87773c05d3.zip |
SONAR-4303 fix canceling of comment edit form
Diffstat (limited to 'sonar-server/src/main')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb | 7 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/javascripts/issue.js | 20 |
2 files changed, 7 insertions, 20 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb index bc5ae43b029..ea985230a3f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb @@ -39,7 +39,12 @@ class IssueController < ApplicationController if params[:modal] render :partial => 'issue/show_modal' elsif request.xhr? - render :partial => 'issue/show' + if params[:only_detail] + # used when canceling edition of comment -> see issue.js#refreshIssue() + render :partial => 'issue/issue', :locals => {:issue => @issue_results.first} + else + render :partial => 'issue/show' + end else render :action => 'show' end diff --git a/sonar-server/src/main/webapp/javascripts/issue.js b/sonar-server/src/main/webapp/javascripts/issue.js index f57267528b3..410d37a1ed8 100644 --- a/sonar-server/src/main/webapp/javascripts/issue.js +++ b/sonar-server/src/main/webapp/javascripts/issue.js @@ -52,10 +52,6 @@ function submitIssueForm(elt) { var issueKey = issueElt.attr('data-issue-key'); var replaced = $j(htmlResponse); issueElt.replaceWith(replaced); - - // re-enable the links opening modal popups - replaced.find('.open-modal').modal(); - notifyIssueChange(issueKey) } ).fail(function (jqXHR, textStatus) { @@ -80,10 +76,6 @@ function doIssueAction(elt, action, parameters) { ).success(function (htmlResponse) { var replaced = $j(htmlResponse); issueElt.replaceWith(replaced); - - // re-enable the links opening modal popups - replaced.find('.open-modal').modal(); - notifyIssueChange(issueKey); } ).fail(function (jqXHR, textStatus) { @@ -140,10 +132,6 @@ function doEditIssueComment(elt) { success: function (htmlResponse) { var replaced = $j(htmlResponse); issueElt.replaceWith(replaced); - - // re-enable the links opening modal popups - replaced.find('.open-modal').modal(); - notifyIssueChange(issueKey); } }); @@ -153,12 +141,9 @@ function doEditIssueComment(elt) { function refreshIssue(elt) { var issueElt = $j(elt).closest('[data-issue-key]'); var issueKey = issueElt.attr('data-issue-key'); - $j.get(baseUrl + "/issue/show/" + issueKey, function (html) { + $j.get(baseUrl + "/issue/show/" + issueKey + "?only_detail=true", function (html) { var replaced = $j(html); issueElt.replaceWith(replaced); - - // re-enable the links opening modal popups - replaced.find('.open-modal').modal(); }); return false; } @@ -191,9 +176,6 @@ function submitCreateIssueForm(elt) { ).success(function (html) { var replaced = $j(html); formElt.replaceWith(replaced); - - // enable the links opening modal popups - replaced.find('.open-modal').modal(); } ).error(function (jqXHR, textStatus, errorThrown) { var errorsElt = formElt.find('.code-issue-errors'); |