aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/coding-rules/rule-details-view.js')
-rw-r--r--server/sonar-web/src/main/js/coding-rules/rule-details-view.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/coding-rules/rule-details-view.js b/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
index 433acd69bf5..2f608db03a3 100644
--- a/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
+++ b/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
@@ -66,6 +66,7 @@ define([
if (this.model.get('isTemplate')) {
this.fetchCustomRules();
}
+ this.listenTo(this.options.app.state, 'change:selectedIndex', this.select);
},
onRender: function () {
@@ -129,12 +130,10 @@ define([
var that = this;
key('up', 'details', function () {
that.options.app.controller.selectPrev();
- that.options.app.controller.showDetailsForSelected();
return false;
});
key('down', 'details', function () {
that.options.app.controller.selectNext();
- that.options.app.controller.showDetailsForSelected();
return false;
});
key('left, backspace', 'details', function () {
@@ -177,6 +176,12 @@ define([
});
},
+ select: function () {
+ var selected = this.options.app.state.get('selectedIndex'),
+ selectedRule = this.options.app.list.at(selected);
+ this.options.app.controller.showDetails(selectedRule);
+ },
+
serializeData: function () {
var isManual = this.model.get('isManual'),
isCustom = this.model.has('templateKey'),