diff options
author | stephenbroyer <stephen.broyer@sonarsource.com> | 2013-09-26 14:26:27 +0200 |
---|---|---|
committer | stephenbroyer <stephen.broyer@sonarsource.com> | 2013-09-26 15:19:36 +0200 |
commit | bcf012dbf7f53c9ec22a6aa8b4c8f0c9409a884e (patch) | |
tree | 64846c39433c876aa951e1b2355c7fb43b3ebe3d /sonar-server/src | |
parent | 71a9e5a196c96ff06e4c92480cfc46df6a83012b (diff) | |
download | sonarqube-bcf012dbf7f53c9ec22a6aa8b4c8f0c9409a884e.tar.gz sonarqube-bcf012dbf7f53c9ec22a6aa8b4c8f0c9409a884e.zip |
SONAR 4726 - Remove prototypejs from home-made JS libs
(duplication.js)
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/javascripts/duplication.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sonar-server/src/main/webapp/javascripts/duplication.js b/sonar-server/src/main/webapp/javascripts/duplication.js index b563873dafa..edd28f41fee 100644 --- a/sonar-server/src/main/webapp/javascripts/duplication.js +++ b/sonar-server/src/main/webapp/javascripts/duplication.js @@ -1,16 +1,21 @@ // JS scripts used in the duplication tab of the resource viewer function updateDuplicationLines(url, groupId, itemId, linesCount, fromLine, toLine) { - $$('#duplGroup_' + groupId + ' p.selected').invoke('removeClassName', 'selected'); - $('duplCount-' + groupId + '-' + itemId).addClassName('selected'); - $('duplFrom-' + groupId + '-' + itemId).addClassName('selected'); - $('duplName-' + groupId + '-' + itemId).addClassName('selected'); - $('duplLoading-' + groupId).addClassName('loading'); + $j('#duplGroup_' + groupId + ' p.selected').removeClass('selected'); + $j('#duplCount-' + groupId + '-' + itemId).addClass('selected'); + $j('#duplFrom-' + groupId + '-' + itemId).addClass('selected'); + $j('#duplName-' + groupId + '-' + itemId).addClass('selected'); + $j('#duplLoading-' + groupId).addClass('loading'); - if ($('source-' + groupId).childElements()[0].hasClassName('expanded')) { + if ($j('#source-' + groupId+ ' :first-child').hasClass('expanded')) { toLine = fromLine + linesCount - 1; } - - new Ajax.Updater('source-' + groupId, url + "&to_line=" + toLine + "&from_line=" + fromLine + "&lines_count=" + linesCount + "&group_index=" + groupId, {asynchronous:true, evalScripts:true}); + $j.ajax({ + url: url + "&to_line=" + toLine + "&from_line=" + fromLine + "&lines_count=" + linesCount + "&group_index=" + groupId, + success:function(response){ + $j('#source-' + groupId).html(response); + }, + type:'get' + }); return false; }
\ No newline at end of file |