fix line numbering

This commit is contained in:
Sven Fuchs 2013-03-14 17:18:34 +01:00
parent e1a667407f
commit c011cfafcd
2 changed files with 13 additions and 11 deletions

View File

@ -81,7 +81,7 @@ Travis.reopen
numberLineOnHover: ->
$('#log').on 'mouseenter', 'a', ->
$(this).attr('href', '#L' + ($(this.parentNode).prevAll('p:visible').length + 1))
$(@).attr('href', '#L' + ($("#log p:visible").index(@parentNode) + 1))
click: ->
if (href = $(event.target).attr('href')) && matches = href?.match(/#L(\d+)$/)
@ -113,7 +113,7 @@ Log.Scroll.prototype = $.extend new Log.Listener,
true
tryScroll: ->
if element = $("#log > p:visible")[@number - 1]
if element = $("#log p:visible")[@number - 1]
$('#main').scrollTop(0)
$('html, body').scrollTop($(element).offset()?.top) # weird, html works in chrome, body in firefox
@highlight(element)

View File

@ -49,16 +49,18 @@ pre#log
&.open
height: auto
&.active
p:first-of-type
padding-right: 130px
background: $color-bg-log-fold inline-image('ui/log.fold.open.2.png') no-repeat 8px 3px
p:first-of-type
padding-right: 130px
&:not(.open) p:first-of-type
visibility: visible
height: auto
min-height: 16px
background-image: inline-image('ui/log.fold.closed.3.png')
// &.active
p:first-of-type
background: $color-bg-log-fold inline-image('ui/log.fold.open.2.png') no-repeat 8px 3px
&:not(.open) p:first-of-type
visibility: visible
height: auto
min-height: 16px
background-image: inline-image('ui/log.fold.closed.3.png')
.fold-name
position: absolute