aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/common/action-options-view.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-02-22 10:39:30 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-02-22 11:17:19 +0100
commitef39ea00c5822b114d728f73d92eed6635437b98 (patch)
tree14cc3591232af48f70ab6d440fc116e0bd05e739 /server/sonar-web/src/main/js/components/common/action-options-view.js
parenta8b9c87ee38ab2458bd0293b1ee099266b7789ab (diff)
downloadsonarqube-ef39ea00c5822b114d728f73d92eed6635437b98.tar.gz
sonarqube-ef39ea00c5822b114d728f73d92eed6635437b98.zip
improve code quality
Diffstat (limited to 'server/sonar-web/src/main/js/components/common/action-options-view.js')
-rw-r--r--server/sonar-web/src/main/js/components/common/action-options-view.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/server/sonar-web/src/main/js/components/common/action-options-view.js b/server/sonar-web/src/main/js/components/common/action-options-view.js
index d32149057d6..3151a4bbcab 100644
--- a/server/sonar-web/src/main/js/components/common/action-options-view.js
+++ b/server/sonar-web/src/main/js/components/common/action-options-view.js
@@ -28,57 +28,57 @@ export default PopupView.extend({
options: '.menu > li > a'
},
- events: function () {
+ events () {
return {
'click @ui.options': 'selectOption',
'mouseenter @ui.options': 'activateOptionByPointer'
};
},
- initialize: function () {
+ initialize () {
this.bindShortcuts();
},
- onRender: function () {
+ onRender () {
PopupView.prototype.onRender.apply(this, arguments);
this.selectInitialOption();
},
- getOptions: function () {
+ getOptions () {
return this.$('.menu > li > a');
},
- getActiveOption: function () {
+ getActiveOption () {
return this.getOptions().filter('.active');
},
- makeActive: function (option) {
+ makeActive (option) {
if (option.length > 0) {
this.getOptions().removeClass('active').tooltip('hide');
option.addClass('active').tooltip('show');
}
},
- selectInitialOption: function () {
+ selectInitialOption () {
this.makeActive(this.getOptions().first());
},
- selectNextOption: function () {
+ selectNextOption () {
this.makeActive(this.getActiveOption().parent().nextAll('li:not(.divider)').first().children('a'));
return false;
},
- selectPreviousOption: function () {
+ selectPreviousOption () {
this.makeActive(this.getActiveOption().parent().prevAll('li:not(.divider)').first().children('a'));
return false;
},
- activateOptionByPointer: function (e) {
+ activateOptionByPointer (e) {
this.makeActive($(e.currentTarget));
},
- bindShortcuts: function () {
- var that = this;
+ bindShortcuts () {
+ const that = this;
this.currentKeyScope = key.getScope();
key.setScope(this.keyScope);
key('down', this.keyScope, function () {
@@ -101,7 +101,7 @@ export default PopupView.extend({
});
},
- unbindShortcuts: function () {
+ unbindShortcuts () {
key.unbind('down', this.keyScope);
key.unbind('up', this.keyScope);
key.unbind('return', this.keyScope);
@@ -112,19 +112,19 @@ export default PopupView.extend({
key.setScope(this.currentKeyScope);
},
- onDestroy: function () {
+ onDestroy () {
PopupView.prototype.onDestroy.apply(this, arguments);
this.unbindShortcuts();
this.$('[data-toggle="tooltip"]').tooltip('destroy');
$('.tooltip').remove();
},
- selectOption: function (e) {
+ selectOption (e) {
e.preventDefault();
this.destroy();
},
- selectActiveOption: function () {
+ selectActiveOption () {
this.getActiveOption().click();
}
});