Skip to content

Commit

Permalink
Instead of onload focus, added keyboard shortcut '/' to get search ba…
Browse files Browse the repository at this point in the history
…r in focus.
  • Loading branch information
prajwalit committed Mar 3, 2011
1 parent 2ac356c commit 0288bac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion imdb/imdbac.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,13 @@
}).result(function(event, item) {
location.href = "http://www.imdb.com" + item.url;
});
imdbSearch.focus ();

$ (document).keypress (function (event) {
var et = event.target;
if (event.keyCode === 47 && (et.tagName !== "INPUT" || et.tagName !== "TEXTAREA")) {
event.preventDefault ();
imdbSearch.focus ();
}
});

}());
2 changes: 1 addition & 1 deletion imdb/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "IMDB Autocomplete",
"version": "1.2",
"version": "1.3",
"description": "Autocomplete for IMDB search bar",
"icons": { "128": "icon.jpg" },
"content_scripts": [{
Expand Down

0 comments on commit 0288bac

Please sign in to comment.