Skip to content
Permalink
Browse files

Actually fixes SI-5055. Scaladoc now a zillion times less annoying

  • Loading branch information
heathermiller committed May 19, 2012
1 parent 234390f commit 6296e324485f1d457e561824a3a8ddcafc3a08d8
Showing with 36 additions and 16 deletions.
  1. +36 −16 src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
@@ -25,9 +25,37 @@ $(document).ready(function(){
// Member filter box
var input = $("#textfilter input");
input.bind("keyup", function(event) {
if (event.keyCode == 27)
input.val(""); // escape key
filter(true);

switch ( event.keyCode ) {

case 27: // escape key
input.val("");
filter(true);
break;

case 38: // up
input.val("");
filter(false);
window.scrollTo(0, $("body").offset().top);
input.focus();
break;

case 33: //page up
input.val("");
filter(false);
break;

case 34: //page down
input.val("");
filter(false);
break;

default:
window.scrollTo(0, $("#mbrsel").offset().top);
filter(true);
break;

}
});
input.focus(function(event) {
input.select();
@@ -37,18 +65,13 @@ $(document).ready(function(){
filter();
});
$(document).keydown(function(event) {
if(!event.altKey && !event.ctrlKey &&
(event.keyCode == 27 || (event.keyCode >= 48 && event.keyCode <= 90)) &&
document.activeElement != $("#textfilter input")[0]) {
$("#textfilter input").focus();
}
if(event.keyCode == 9) {

if (event.keyCode == 9) { // tab
$("#index-input", window.parent.document).focus();
input.attr("value", "");
return false;
}
}
});
$("#textfilter input").focus();

$("#linearization li").click(function(){
if ($(this).hasClass("in")) {
@@ -256,7 +279,8 @@ function initInherit() {
});
};

function filter(scrollToMember) {
/* filter used to take boolean scrollToMember */
function filter() {
var query = $.trim($("#textfilter input").val()).toLowerCase();
query = query.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&").replace(/\s+/g, "|");
var queryRegExp = new RegExp(query, "i");
@@ -332,10 +356,6 @@ function filter(scrollToMember) {
members.hide();
};

if (scrollToMember) {
window.scrollTo(0, $("#mbrsel").offset().top);
}

return false;
};

0 comments on commit 6296e32

Please sign in to comment.
You can’t perform that action at this time.