diff options
Diffstat (limited to 'coverage/htmlfiles/coverage_html.js')
-rw-r--r-- | coverage/htmlfiles/coverage_html.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/coverage/htmlfiles/coverage_html.js b/coverage/htmlfiles/coverage_html.js index 2800dd45..fdee5510 100644 --- a/coverage/htmlfiles/coverage_html.js +++ b/coverage/htmlfiles/coverage_html.js @@ -149,25 +149,27 @@ coverage.wire_up_next_buttons = function () { } } - // Set highlight styling and arrow indicator. - $("p[id^='n'].highlight").removeClass("highlight"); - $("p[id^='n'] span.indicator").remove(); + if (target.length > 0) { + // Set highlight styling and arrow indicator. + $("p[id^='n'].highlight").removeClass("highlight"); + $("p[id^='n'] span.indicator").remove(); - $("p#n" + target.attr("id").match(/\d+/)[0]) - .prepend( + $("p#n" + target.attr("id").match(/\d+/)[0]) + .prepend( $("<span />") .addClass("indicator") .html("◊") ) - .addClass("highlight") + .addClass("highlight"); - // Scroll to line. - $("html, body").animate({ - scrollTop: (target.position().top - ($("#header").outerHeight() + 100)) - }, 100); + // Scroll to line. + $("html, body").animate({ + scrollTop: (target.position().top - ($("#header").outerHeight() + 100)) + }, 100); - // Save target reference in button element for next click. - $(this).data("target", target); + // Save target reference in button element for next click. + $(this).data("target", target); + } return false; } |