$ = jQuery
- TOP_OFFSET = 43
COMPONENT_HEIGHT = 29
BOTTOM_OFFSET = 10
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
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();