diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-09-21 10:01:07 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-09-21 10:01:15 +0200 |
commit | 8c45a3db50f91ca96f74af0709df9351b02704dc (patch) | |
tree | 8760e46c5c930d1743b6e2bfa7c96ae2619a0573 /server/sonar-web/src/main/js/apps/coding-rules/controller.js | |
parent | 46445984cf50ef0dda050ea8d369c89936e97f9f (diff) | |
download | sonarqube-8c45a3db50f91ca96f74af0709df9351b02704dc.tar.gz sonarqube-8c45a3db50f91ca96f74af0709df9351b02704dc.zip |
SONAR-6207 Provide a keyboard shortcut to activate a rule from the list of rules
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules/controller.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/coding-rules/controller.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/controller.js b/server/sonar-web/src/main/js/apps/coding-rules/controller.js index dad6224391a..2049cb8bf0c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/controller.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/controller.js @@ -140,15 +140,21 @@ export default Controller.extend({ }, activateCurrent: function () { - var rule = this.app.list.at(this.app.state.get('selectedIndex')); - var ruleView = this.app.workspaceListView.children.findByModel(rule); - ruleView.$('.coding-rules-detail-quality-profile-activate').click(); + if (this.app.layout.detailsShow()) { + this.app.workspaceDetailsView.$('#coding-rules-quality-profile-activate').click(); + } else { + var rule = this.app.list.at(this.app.state.get('selectedIndex')); + var ruleView = this.app.workspaceListView.children.findByModel(rule); + ruleView.$('.coding-rules-detail-quality-profile-activate').click(); + } }, deactivateCurrent: function () { - var rule = this.app.list.at(this.app.state.get('selectedIndex')); - var ruleView = this.app.workspaceListView.children.findByModel(rule); - ruleView.$('.coding-rules-detail-quality-profile-deactivate').click(); + if (!this.app.layout.detailsShow()) { + var rule = this.app.list.at(this.app.state.get('selectedIndex')); + var ruleView = this.app.workspaceListView.children.findByModel(rule); + ruleView.$('.coding-rules-detail-quality-profile-deactivate').click(); + } } }); |