Skip to content

Commit

Permalink
make the help dialog come up when users press "?", and go away if the…
Browse files Browse the repository at this point in the history
…y press any key
  • Loading branch information
rbuels committed Mar 28, 2012
1 parent c70a9a1 commit 1987c6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/Browser.js
Expand Up @@ -708,6 +708,13 @@ Browser.prototype.makeHelpDialog = function () {
helplink.style.cursor = 'help';
helplink.appendChild( document.createTextNode('Help'));
dojo.connect(helplink, 'onclick', function() { dialog.show(); });
dojo.connect(document.body, 'onkeydown', function() { dialog.hide(); } );
dojo.connect(document.body, 'onkeypress', function( evt ) {
if( evt.keyChar == '?' )
dialog.show();
else
dialog.hide();
});

return helplink;
};
Expand Down

0 comments on commit 1987c6a

Please sign in to comment.