diff options
author | Ned Batchelder <nedbat@gmail.com> | 2018-05-28 11:12:04 +0000 |
---|---|---|
committer | Ned Batchelder <nedbat@gmail.com> | 2018-05-28 11:12:04 +0000 |
commit | b1977499ed7a9bb64c1687454c979b8e7d2703da (patch) | |
tree | abcfbdde28cbee3f645ca369bc541ffb15f5586e /coverage/htmlfiles/coverage_html.js | |
parent | c1b54c2433e4f23c61354303d9e3698704f5a3f7 (diff) | |
parent | fe5997ec194948afde3bd211d2ee6db329725abc (diff) | |
download | python-coveragepy-git-b1977499ed7a9bb64c1687454c979b8e7d2703da.tar.gz |
Merged in pankajp/coveragepy/pankajp/faster-html-report-ui (pull request #141)
Faster html report ui in browser
Diffstat (limited to 'coverage/htmlfiles/coverage_html.js')
-rw-r--r-- | coverage/htmlfiles/coverage_html.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/coverage/htmlfiles/coverage_html.js b/coverage/htmlfiles/coverage_html.js index f6f5de20..b7fbd9c9 100644 --- a/coverage/htmlfiles/coverage_html.js +++ b/coverage/htmlfiles/coverage_html.js @@ -555,11 +555,14 @@ coverage.resize_scroll_markers = function () { var previous_line = -99, last_mark, - last_top; + last_top, + offsets = {}; + // Calculate line offsets outside loop to prevent relayouts + c.missed_lines.each(function(){offsets[this.id] = $(this).offset().top}); c.missed_lines.each(function () { - var line_top = Math.round($(this).offset().top * marker_scale), - id_name = $(this).attr('id'), + var id_name = $(this).attr('id'), + line_top = Math.round(offsets[id_name] * marker_scale), line_number = parseInt(id_name.substring(1, id_name.length)); if (line_number === previous_line + 1) { |