]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5134 Fix issue with keyboard navigation
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 11 Jun 2014 16:52:05 +0000 (18:52 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 11 Jun 2014 16:52:17 +0000 (18:52 +0200)
sonar-server/src/main/coffee/coding-rules/views/coding-rules-list-view.coffee
sonar-server/src/main/hbs/coding-rules/coding-rules-list-item.hbs

index 51093f9124a3508646dae0fdbe77264528a5defe..b62e4a288666222c89dcb9e9162a9f6c6a4fc017 100644 (file)
@@ -54,8 +54,8 @@ define [
     selectIssue: (el, open) ->
       @$('.active').removeClass 'active'
       el.addClass 'active'
-      ruleTitle = el.find('[title]').attr('title')
-      rule = @collection.findWhere name: ruleTitle
+      ruleKey = el.find('[name]').attr('name')
+      rule = @collection.findWhere key: ruleKey
       @selected = @collection.indexOf(rule)
       @openRule el if open
 
@@ -71,9 +71,9 @@ define [
 
 
     selectNext: ->
-      if @selected < @collection.length - 1
-        @selected++
-        child = @$el.children().eq @selected
+      if @selected + 1 < @collection.length
+        @selected += 1
+        child = @$el.children().eq(@selected)
         container = jQuery('.navigator-results')
         containerHeight = container.height()
         bottom = child.position().top + child.outerHeight()
@@ -84,8 +84,8 @@ define [
 
     selectPrev: ->
       if @selected > 0
-        @selected--
-        child = @$el.children().eq @selected
+        @selected -= 1
+        child = @$el.children().eq(@selected)
         container = jQuery('.navigator-results')
         top = child.position().top
         if top < 0
index 89edb99d02518470e02b6c3e0585387fd73a34a7..00ec5d80d9da84d17f393b5c62e3f9d778dd2642 100644 (file)
@@ -2,4 +2,4 @@
   <span class="coding-rules-detail-status">{{language}}</span>
   <div class="line-right">{{#notEq status 'READY'}}{{status}}{{/notEq}}</div>
 </div>
-<div class="line line-nowrap" title="{{name}}">{{name}}</div>
+<div class="line line-nowrap" title="{{name}}" name="{{key}}">{{name}}</div>