]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5820 Improve performance
authorStas Vilchik <vilchiks@gmail.com>
Tue, 6 Jan 2015 13:45:26 +0000 (14:45 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 6 Jan 2015 13:45:26 +0000 (14:45 +0100)
server/sonar-web/src/main/js/coding-rules/controller.js
server/sonar-web/src/main/js/coding-rules/models/rule.js
server/sonar-web/src/main/js/coding-rules/models/rules.js

index bb36840c7c55102e642ffc271581a991fe82f3ae..277803b0f5f4fd1d1b0b9694310ebae3b6df0c3b 100644 (file)
@@ -89,7 +89,7 @@ define([
           };
       return $.get(url, options).done(function (data) {
         rule.set(data.rule);
-        rule.addExtraAttributes(that.app.languages, that.app.repositories);
+        rule.addExtraAttributes(that.app.repositories);
       });
     },
 
index 9363ff689d8d13d8f5ecdbc07c6a7cf611b28376..edfd042fe0a7eb32956166ed81fdbadb557122f6 100644 (file)
@@ -5,18 +5,16 @@ define([
   return Backbone.Model.extend({
     idAttribute: 'key',
 
-    addExtraAttributes: function (languages, repositories) {
-      var langName = languages[this.get('lang')] || this.get('lang'),
-          repo = _.findWhere(repositories, { key: this.get('repo') }) || this.get('repo'),
+    addExtraAttributes: function (repositories) {
+      var repo = _.findWhere(repositories, { key: this.get('repo') }) || this.get('repo'),
           repoName = repo != null ? repo.name : repo,
           isManual = this.get('repo') === 'manual',
           isCustom = this.has('templateKey');
       this.set({
-        langName: langName,
         repoName: repoName,
         isManual: isManual,
         isCustom: isCustom
-      });
+      }, { silent: true });
     }
   });
 
index 752576ee2f82ff2cb5fcb15d7c0863deaa906d1f..12c8aadb0e32d44122869b80ad964dc87888502f 100644 (file)
@@ -16,9 +16,9 @@ define([
       });
     },
 
-    addExtraAttributes: function (languages, repositories) {
+    addExtraAttributes: function (repositories) {
       this.models.forEach(function (model) {
-        model.addExtraAttributes(languages, repositories);
+        model.addExtraAttributes(repositories);
       });
     }
   });