Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: pkg/dartdoc/lib/src/client/dropdown.dart

Issue 11036058: Show top-level members (again). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dartdoc/lib/dartdoc.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartdoc/lib/src/client/dropdown.dart
diff --git a/pkg/dartdoc/lib/src/client/dropdown.dart b/pkg/dartdoc/lib/src/client/dropdown.dart
index 7caa931b98e86638a528f6574c628a878aa212f7..8da62bcbdc4a3b2af2dd6e51a02be36689a9db26 100644
--- a/pkg/dartdoc/lib/src/client/dropdown.dart
+++ b/pkg/dartdoc/lib/src/client/dropdown.dart
@@ -322,15 +322,13 @@ void hideDropDown() {
dropdown.style.visibility = 'hidden';
}
-bool searchInputFocused = false;
-
/** Activate search on Ctrl+3 and S. */
void shortcutHandler(KeyboardEvent event) {
if (event.keyCode == 0x33/* 3 */ && event.ctrlKey) {
searchInput.focus();
event.preventDefault();
- } else if (!searchInputFocused && event.keyCode == 0x53/* S */) {
- // Avoid preventing writing 's' in the search input.
+ } else if (event.target != searchInput && event.keyCode == 0x53/* S */) {
+ // Allow writing 's' in the search input.
searchInput.focus();
event.preventDefault();
}
@@ -341,9 +339,6 @@ void shortcutHandler(KeyboardEvent event) {
*/
void setupShortcuts() {
window.on.keyDown.add(shortcutHandler);
- searchInput = query('#q');
- searchInput.on.focus.add((event) => searchInputFocused = true);
- searchInput.on.blur.add((event) => searchInputFocused = false);
}
/** Setup search hooks. */
« no previous file with comments | « pkg/dartdoc/lib/dartdoc.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698