aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/quality-profiles/profile-comparison-view.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles/profile-comparison-view.js')
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/profile-comparison-view.js78
1 files changed, 39 insertions, 39 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/profile-comparison-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/profile-comparison-view.js
index 522c75d16e0..aab7018aac6 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/profile-comparison-view.js
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/profile-comparison-view.js
@@ -1,41 +1,41 @@
-define([
- './templates'
-], function () {
-
- return Marionette.ItemView.extend({
- template: Templates['quality-profile-comparison'],
-
- events: {
- 'submit #quality-profile-comparison-form': 'onFormSubmit'
- },
-
- onRender: function () {
- this.$('select').select2({
- width: '250px',
- minimumResultsForSearch: 50
- });
- },
-
- onFormSubmit: function (e) {
- e.preventDefault();
- var withKey = this.$('#quality-profile-comparison-with-key').val();
- this.model.compareWith(withKey);
- },
-
- getProfilesForComparison: function () {
- var profiles = this.model.collection.toJSON(),
- key = this.model.id,
- language = this.model.get('language');
- return profiles.filter(function (profile) {
- return profile.language === language && key !== profile.key;
- });
- },
-
- serializeData: function () {
- return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
- profiles: this.getProfilesForComparison()
- });
- }
- });
+import _ from 'underscore';
+import Marionette from 'backbone.marionette';
+import './templates';
+export default Marionette.ItemView.extend({
+ template: Templates['quality-profile-comparison'],
+
+ events: {
+ 'submit #quality-profile-comparison-form': 'onFormSubmit'
+ },
+
+ onRender: function () {
+ this.$('select').select2({
+ width: '250px',
+ minimumResultsForSearch: 50
+ });
+ },
+
+ onFormSubmit: function (e) {
+ e.preventDefault();
+ var withKey = this.$('#quality-profile-comparison-with-key').val();
+ this.model.compareWith(withKey);
+ },
+
+ getProfilesForComparison: function () {
+ var profiles = this.model.collection.toJSON(),
+ key = this.model.id,
+ language = this.model.get('language');
+ return profiles.filter(function (profile) {
+ return profile.language === language && key !== profile.key;
+ });
+ },
+
+ serializeData: function () {
+ return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
+ profiles: this.getProfilesForComparison()
+ });
+ }
});
+
+