From c011cfafcd3938ea77d7de7496dc17bd3e7e4335 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Thu, 14 Mar 2013 17:18:34 +0100 Subject: [PATCH] fix line numbering --- assets/scripts/app/views/log.coffee | 4 ++-- assets/styles/main/log.sass | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/assets/scripts/app/views/log.coffee b/assets/scripts/app/views/log.coffee index ca585413..2816932d 100644 --- a/assets/scripts/app/views/log.coffee +++ b/assets/scripts/app/views/log.coffee @@ -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) diff --git a/assets/styles/main/log.sass b/assets/styles/main/log.sass index 4b818fad..5c252e1f 100644 --- a/assets/styles/main/log.sass +++ b/assets/styles/main/log.sass @@ -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