summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/html/htmlsearchresult.tpl6
-rw-r--r--templates/html/search.js5
2 files changed, 8 insertions, 3 deletions
diff --git a/templates/html/htmlsearchresult.tpl b/templates/html/htmlsearchresult.tpl
index db37a5d..4e15414 100644
--- a/templates/html/htmlsearchresult.tpl
+++ b/templates/html/htmlsearchresult.tpl
@@ -24,6 +24,12 @@ document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
+window.addEventListener("message", function(event) {
+ if (event.data == "take_focus") {
+ var elem = searchResults.NavNext(0);
+ if (elem) elem.focus();
+ }
+});
/* @license-end */
--></script>
</div>
diff --git a/templates/html/search.js b/templates/html/search.js
index a554ab9..86fbb9c 100644
--- a/templates/html/search.js
+++ b/templates/html/search.js
@@ -200,10 +200,9 @@ function SearchBox(name, resultsPath, inFrame, label)
}
return;
}
- else if (window.frames.MSearchResults.searchResults)
+ else
{
- var elem = window.frames.MSearchResults.searchResults.NavNext(0);
- if (elem) elem.focus();
+ window.frames.MSearchResults.postMessage("take_focus", "*");
}
}
else if (e.keyCode==27) // Escape out of the search field