Skip to content

Commit 963c4a7

Browse files
committed
Actual SI-6555 fix, Scaladoc filter works WITH keyboard shortcuts too
Commit daefab1 attempted to fix a bug related to Scaladoc filtering, meanwhile breaking Scaladoc keyboard shortcuts. Before commit daefab1, Scaladoc's filter wouldn't consider the last character of a search term entered into the (left) Scaladoc filter pane, but toggling with the `tab` key between filter panes did work. After daefab1, Scaladoc's left pane filter correctly searches for the full search term, but pressing the `tab` key causes the "focus" of the input bar to be stuck on the filter panel in the right Scaladoc filter pane, rendering it useless. End result: annoying Scaladoc interface bug present in 2.10.1, but which wasn't present in 2.10.0. This pull request fixes this, enabling both behaviors. The `tab` key toggle needed to be triggered on a `keydown` event (currently it's not), while everything else is fine to be triggered on a `keyup` event. This pull request enables the correct behavior by binding both a `keydown` and a `keyup` event rather than lumping everything all together in a `keyup` event (as was the case before).
1 parent 76b8724 commit 963c4a7

File tree

1 file changed

+10
-7
lines changed
  • src/compiler/scala/tools/nsc/doc/html/resource/lib

1 file changed

+10
-7
lines changed

src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ var title = $(document).attr('title');
1414
var lastHash = "";
1515

1616
$(document).ready(function() {
17-
$('body').layout({
17+
$('body').layout({
1818
west__size: '20%',
19-
center__maskContents: true
19+
center__maskContents: true
2020
});
2121
$('#browser').layout({
2222
center__paneSelector: ".ui-west-center"
@@ -342,18 +342,21 @@ function configureTextFilter() {
342342
if (event.keyCode == 27) { // escape
343343
input.attr("value", "");
344344
}
345-
if (event.keyCode == 9) { // tab
346-
$("#template").contents().find("#mbrsel-input").focus();
347-
input.attr("value", "");
348-
return false;
349-
}
350345
if (event.keyCode == 40) { // down arrow
351346
$(window).unbind("keydown");
352347
keyboardScrolldownLeftPane();
353348
return false;
354349
}
355350
textFilter();
356351
});
352+
input.bind('keydown', function(event) {
353+
if (event.keyCode == 9) { // tab
354+
$("#template").contents().find("#mbrsel-input").focus();
355+
input.attr("value", "");
356+
return false;
357+
}
358+
textFilter();
359+
});
357360
input.focus(function(event) { input.select(); });
358361
});
359362
scheduler.add("init", function() {

0 commit comments

Comments
 (0)