diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-09-17 16:15:28 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-09-18 10:47:27 +0200 |
commit | 890ab0b59cdb3902f4869eabf8ca534814f1b3dd (patch) | |
tree | 0ed74726957e590f6506e378366ea15bf21bfcbd /server/sonar-web/src/main/js/apps/quality-profiles/profile-view.js | |
parent | ce60ac8d2e137f33bb111668e54e78c195c73d79 (diff) | |
download | sonarqube-890ab0b59cdb3902f4869eabf8ca534814f1b3dd.tar.gz sonarqube-890ab0b59cdb3902f4869eabf8ca534814f1b3dd.zip |
migrate js apps to es2015 modules
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles/profile-view.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-profiles/profile-view.js | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/profile-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/profile-view.js index 19ddacf5e71..541482a5569 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/profile-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/profile-view.js @@ -1,41 +1,41 @@ -define([ - './templates' -], function () { - - return Marionette.ItemView.extend({ - tagName: 'a', - className: 'list-group-item', - template: Templates['quality-profiles-profile'], - - modelEvents: { - 'change': 'render' - }, - - events: { - 'click': 'onClick' - }, - - onRender: function () { - this.$el.toggleClass('active', this.options.highlighted); - this.$el.attr('data-key', this.model.id); - this.$el.attr('data-language', this.model.get('language')); - this.$('[data-toggle="tooltip"]').tooltip({ container: 'body' }); - }, - - onDestroy: function () { - this.$('[data-toggle="tooltip"]').tooltip('destroy'); - }, - - onClick: function (e) { - e.preventDefault(); - this.model.trigger('select', this.model); - }, - - serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - projectCountFormatted: window.formatMeasure(this.model.get('projectCount'), 'INT') - }); - } - }); - +import _ from 'underscore'; +import Marionette from 'backbone.marionette'; +import './templates'; + +export default Marionette.ItemView.extend({ + tagName: 'a', + className: 'list-group-item', + template: Templates['quality-profiles-profile'], + + modelEvents: { + 'change': 'render' + }, + + events: { + 'click': 'onClick' + }, + + onRender: function () { + this.$el.toggleClass('active', this.options.highlighted); + this.$el.attr('data-key', this.model.id); + this.$el.attr('data-language', this.model.get('language')); + this.$('[data-toggle="tooltip"]').tooltip({ container: 'body' }); + }, + + onDestroy: function () { + this.$('[data-toggle="tooltip"]').tooltip('destroy'); + }, + + onClick: function (e) { + e.preventDefault(); + this.model.trigger('select', this.model); + }, + + serializeData: function () { + return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { + projectCountFormatted: window.formatMeasure(this.model.get('projectCount'), 'INT') + }); + } }); + + |