]> source.dussan.org Git - sonarqube.git/commitdiff
fix scrolling by keyboard on issues and rules pages
authorStas Vilchik <vilchiks@gmail.com>
Fri, 20 Feb 2015 14:11:25 +0000 (15:11 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 20 Feb 2015 14:11:33 +0000 (15:11 +0100)
server/sonar-web/src/main/coffee/issues/workspace-list-view.coffee
server/sonar-web/src/main/js/components/navigator/workspace-list-view.js

index 7c429bc6cfde4ba66f3824726007f54491be7dfa..f6652c11b04edf158b84935f8296b4ab4d0334db 100644 (file)
@@ -11,7 +11,6 @@ define [
 
   $ = jQuery
 
-  TOP_OFFSET = 43
   COMPONENT_HEIGHT = 29
   BOTTOM_OFFSET = 10
 
@@ -51,7 +50,8 @@ define [
       selectedIssue = @collection.at @options.app.state.get 'selectedIndex'
       return unless selectedIssue?
       selectedIssueView = @children.findByModel selectedIssue
-      viewTop = selectedIssueView.$el.offset().top - TOP_OFFSET
+      parentTopOffset = @$el.offset().top
+      viewTop = selectedIssueView.$el.offset().top - parentTopOffset
       if selectedIssueView.$el.prev().is('.issues-workspace-list-component')
         viewTop -= COMPONENT_HEIGHT
       viewBottom = selectedIssueView.$el.offset().top + selectedIssueView.$el.outerHeight() + BOTTOM_OFFSET
index 096ef1d4fb370068626fa8e1260584572033b582..7ce0d8da7edf1e3507c7fd2db07a9d3f2a01861a 100644 (file)
@@ -93,7 +93,8 @@ define(function () {
         return;
       }
       var selectedView = this.children.findByModel(selected),
-          viewTop = selectedView.$el.offset().top,
+          parentTopOffset = this.$el.offset().top,
+          viewTop = selectedView.$el.offset().top - parentTopOffset,
           viewBottom = selectedView.$el.offset().top + selectedView.$el.outerHeight(),
           windowTop = $(window).scrollTop(),
           windowBottom = windowTop + $(window).height();