Permalink
Browse files

jump to first result when doing direct url searches

  • Loading branch information...
1 parent 94b248f commit 480c017dafe7674c6a150484cb1c1025b8849569 Dale Harvey committed Feb 3, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 priv/static/erldocs.js
@@ -248,6 +248,14 @@ var ErlDocs = (function(index) {
val = decodeURIComponent(qs.search.replace(/\+/g, " "));
$search.val(val);
filter(val);
+
+ // If a search parameter is specified and hash doesnt already
+ // exist, jump to first match
+ if (document.location.hash === "") {
+ document.location.hash =
+ $("#results li:first-child a").attr("href").split("#")[1];
+ }
+
} else {
$search.val($search.attr("placeholder"));
filter();

0 comments on commit 480c017

Please sign in to comment.