]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5057 Remove Prototype.JS from SonarQube
authorStas Vilchik <vilchiks@gmail.com>
Sun, 2 Mar 2014 15:14:34 +0000 (16:14 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Sun, 2 Mar 2014 15:14:34 +0000 (16:14 +0100)
Use native forEach instead of prototype's each

sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb
sonar-server/src/main/webapp/javascripts/application.js
sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js

index c7e410e56481a7b73d0a1084ab479de619a66a7e..30c43cc9aa05d36fa460c25ca3eb521f10b39321 100644 (file)
@@ -87,7 +87,7 @@
 
   function filtersWidgetsByContent(text) {
     var userInput = text.toLowerCase();
-    widgetContents.each(function (widget) {
+    widgetContents.forEach(function (widget) {
       var element = $j('#'+widget.id);
       if (element != null) {
         if (widget.c.indexOf(userInput) != -1) {
index 318b8216d733b500ba09649eb627548598c428d4..65fa62fce16b6c23013716f7b550bd66d9cc0926 100644 (file)
@@ -217,7 +217,7 @@ Treemap.prototype.currentContext = function () {
 Treemap.prototype.load = function () {
   var context = this.currentContext();
   var output = '';
-  this.breadcrumb.each(function (ctx) {
+  this.breadcrumb.forEach(function (ctx) {
     output += ctx.label + '&nbsp;/&nbsp;';
   });
   $j('#tm-bc-' + this.id).html(output);
index 26257f9bb3cbf3a226f3d4271f5319d7e1f3b17b..02bb8e255399eb6ecd1e4122a37f981919f55fdd 100644 (file)
@@ -132,7 +132,7 @@ define(['backbone', 'navigator/filters/base-filters', 'navigator/filters/choice-
             ps: PAGE_SIZE
           },
           success: function() {
-            selected.each(function(item) {
+            selected.forEach(function(item) {
               that.options.filterView.choices.unshift(item);
             });
             _.each(that.model.get('choices'), function(v, k) {