From 56026f10f6fb8a6cce270cf2b169f724470ce96d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 20 Apr 2011 22:35:00 -0400 Subject: Keyboard-shorcut help is now available on the file page of the HTML report. --- coverage/htmlfiles/coverage_html.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'coverage/htmlfiles/coverage_html.js') 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) { -- cgit v1.2.1