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 | b09e3ac89c7b4f7a4b4f37c0ba726f9fb405803b (patch) | |
tree | ede330d6790e2688b3b3476daf54c7c744f40fd5 /coverage/htmlfiles/coverage_html.js | |
parent | 7796f09d9e119760d1d19eadd0583f373c8ae382 (diff) | |
download | python-coveragepy-b09e3ac89c7b4f7a4b4f37c0ba726f9fb405803b.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 e01793f..e95a9ef 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) { |