Permalink
Browse files

Added Scaladoc keyboard shortcut: tab toggles between panels

  • Loading branch information...
heathermiller committed May 18, 2012
1 parent ef77088 commit 8b1eb6ceda215b596b8f4a5afed8d7c7bf370c20
@@ -44,7 +44,7 @@ class Index(universe: doc.Universe, index: doc.Index) extends HtmlPage {
</div>
{ browser }
<div id="content" class="ui-layout-center">
- <iframe name="template" src={ relativeLinkTo{List("package.html")} }/>
+ <iframe id="template" src={ relativeLinkTo{List("package.html")} }/>
</div>
</body>
@@ -87,7 +87,7 @@ class Template(universe: doc.Universe, tpl: DocTemplateEntity) extends HtmlPage
{ memberToCommentHtml(tpl, true) }
<div id="mbrsel">
- <div id='textfilter'><span class='pre'/><span class='input'><input type='text' accesskey='/'/></span><span class='post'/></div>
+ <div id='textfilter'><span class='pre'/><span class='input'><input id='mbrsel-input' type='text' accesskey='/'/></span><span class='post'/></div>
{ if (tpl.linearizationTemplates.isEmpty && tpl.conversions.isEmpty) NodeSeq.Empty else
<div id="order">
<span class="filtertype">Ordering</span>
@@ -263,15 +263,20 @@ function prepareEntityList() {
/* Configures the text filter */
function configureTextFilter() {
scheduler.add("init", function() {
- $("#filter").append("<div id='textfilter'><span class='pre'/><span class='input'><input type='text' accesskey='/'/></span><span class='post'/></div>");
+ $("#filter").append("<div id='textfilter'><span class='pre'/><span class='input'><input id='index-input' type='text' accesskey='/'/></span><span class='post'/></div>");
printAlphabet();
var input = $("#textfilter input");
resizeFilterBlock();
- input.bind("keyup", function(event) {
+ input.bind("keydown", function(event) {
if (event.keyCode == 27) { // escape
input.attr("value", "");
+ textFilter();
}
- textFilter();
+ if (event.keyCode == 9) { // tab
+ $("#template").contents().find("#mbrsel-input").focus();
+ input.attr("value", "");
+ return false;
+ }
});
input.focus(function(event) { input.select(); });
});
@@ -42,6 +42,11 @@ $(document).ready(function(){
document.activeElement != $("#textfilter input")[0]) {
$("#textfilter input").focus();
}
+ if(event.keyCode == 9) {
+ $("#index-input", window.parent.document).focus();
+ input.attr("value", "");
+ return false;
+ }
});
$("#textfilter input").focus();

0 comments on commit 8b1eb6c

Please sign in to comment.