diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-04-20 22:35:00 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-04-20 22:35:00 -0400 |
commit | 56026f10f6fb8a6cce270cf2b169f724470ce96d (patch) | |
tree | 9440ca3dd1135dd5f042487cf117473ec5ecafe6 /coverage/htmlfiles/coverage_html.js | |
parent | 2fbb89325ace18b787fc5f392cb7659a36b005dc (diff) | |
download | python-coveragepy-git-56026f10f6fb8a6cce270cf2b169f724470ce96d.tar.gz |
Keyboard-shorcut help is now available on the file page of the HTML report.
Diffstat (limited to 'coverage/htmlfiles/coverage_html.js')
-rw-r--r-- | coverage/htmlfiles/coverage_html.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/coverage/htmlfiles/coverage_html.js b/coverage/htmlfiles/coverage_html.js index e01793f4..e95a9efa 100644 --- a/coverage/htmlfiles/coverage_html.js +++ b/coverage/htmlfiles/coverage_html.js @@ -17,6 +17,25 @@ coverage.assign_shortkeys = function () { }); }; +// Create the events for the help panel. +coverage.wire_up_help_panel = function () { + $("#keyboard_icon").click(function () { + // Show the help panel, and position it so the keyboard icon in the + // panel is in the same place as the keyboard icon in the header. + $(".help_panel").show(); + var top, left; + var koff = $("#keyboard_icon").offset(); + var poff = $("#panel_icon").position(); + $(".help_panel").offset({ + top: koff.top-poff.top, + left: koff.left-poff.left + }); + }); + $("#panel_icon").click(function () { + $(".help_panel").hide(); + }); +}; + // Loaded on index.html coverage.index_ready = function ($) { // Look for a cookie containing previous sort settings: @@ -104,6 +123,7 @@ coverage.pyfile_ready = function ($) { ; coverage.assign_shortkeys(); + coverage.wire_up_help_panel(); }; coverage.toggle_lines = function (btn, cls) { |