diff options
author | David Gageot <david@gageot.net> | 2012-10-29 14:37:23 +0100 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-29 14:38:31 +0100 |
commit | 94b2a9ae7d056e97a4c259102f940098f105403f (patch) | |
tree | b9d3344440566a3093d42d2a70feae9121dc53b7 | |
parent | 52269fe6503177c90a2d1e24fe2fb21ad0c5bf03 (diff) | |
download | sonarqube-94b2a9ae7d056e97a4c259102f940098f105403f.tar.gz sonarqube-94b2a9ae7d056e97a4c259102f940098f105403f.zip |
Refactor javascript to recent jquery code.
.live() is deprecated and less performant
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb index edec9c6a421..fed0c43bc2b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb @@ -66,20 +66,20 @@ <% end -%> <script> - $j('.delete').live('click', function () { - $j(this).parents('.multi_value').remove(); - return false; - }); - - $j('.add_value').live('click', function () { - var template = $j(this).parents('.property').find('.template').last(); - template.clone().insertBefore(template).show(); - return false; - }); - $j('form').live('keypress', function (e) { - if (e.which == 13) { - submit_settings.click(); + $j(document) + .on('click', '.delete', function () { + $j(this).parents('.multi_value').remove(); + return false; + }) + .on('click', '.add_value', function () { + var template = $j(this).parents('.property').find('.template').last(); + template.clone().insertBefore(template).show(); return false; - } - }); + }) + .on('keypress', 'form', function (e) { + if (e.which == 13) { + submit_settings.click(); + return false; + } + }); </script> |