aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstephenbroyer <stephen.broyer@sonarsource.com>2013-09-20 14:15:01 +0200
committerstephenbroyer <stephen.broyer@sonarsource.com>2013-09-20 14:18:05 +0200
commitc6d736b4570557a666f3508477b295df16b2e5e3 (patch)
tree9ac82a2695895f75d26bf4563930de502348d3fc
parentd96219c143aa41a5be020c850e45425c51c3d428 (diff)
downloadsonarqube-c6d736b4570557a666f3508477b295df16b2e5e3.tar.gz
sonarqube-c6d736b4570557a666f3508477b295df16b2e5e3.zip
SONAR-4663 Remove prototypejs from Resource Viewer
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications_source_snippet.html.erb14
1 files changed, 10 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications_source_snippet.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications_source_snippet.html.erb
index 534f1119c26..1bd6b69c5fa 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications_source_snippet.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications_source_snippet.html.erb
@@ -38,10 +38,16 @@
included_to_line = from_line + ResourceHelper::DUPLICATION_SNIPPET_DEFAULT_NB_OF_LINES - 1
end
%>
- <%= link_to_remote link_text,
- :url => {:action => :show_duplication_snippet, :params => {:id => resource.id, :original_resource_id => original_resource.id, :from_line => from_line, :to_line => included_to_line, :lines_count => lines_count, :group_index => group_index}},
- :update => "source-#{group_index}",
- :before => "$('expanding-#{group_index}').addClassName('loading')" -%>
+ <a onclick="
+ $j('#expanding<%= group_index -%>').addClass('loading');
+ $j.ajax({
+ url:'<%= url_for (:action => :show_duplication_snippet, :params => {:id => resource.id, :original_resource_id => original_resource.id, :from_line => from_line, :to_line => included_to_line, :lines_count => lines_count, :group_index => group_index}) -%>',
+ type:'post',
+ success:function(response){$j('#source-<%= group_index -%>').html(response);},
+ complete:function(response){$j('#expanding-<%= group_index -%>').removeClass('loading');}});
+ return false;"
+ href="#">
+ <%= link_text -%></a>
<span id="expanding-<%= group_index -%>"></span>
</p>
<% end %>