summaryrefslogtreecommitdiff
path: root/lib/rdoc/generator/template/darkfish/js
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-14 22:09:35 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-14 22:09:35 +0000
commit23201ab1c4c71c5f53dd3e69dfe1571cade92609 (patch)
tree970aee6f295a9c5b9201f0e62a752711c50d12dc /lib/rdoc/generator/template/darkfish/js
parent0b84ee8f7bb6e62f404cf39e50ffbc761300eef4 (diff)
* lib/rdoc: Update to RDoc master 263a9e5. This improves the
accessibility of the search box. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/generator/template/darkfish/js')
-rw-r--r--lib/rdoc/generator/template/darkfish/js/search.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rdoc/generator/template/darkfish/js/search.js b/lib/rdoc/generator/template/darkfish/js/search.js
index 563ed7e54e..60ac295e6c 100644
--- a/lib/rdoc/generator/template/darkfish/js/search.js
+++ b/lib/rdoc/generator/template/darkfish/js/search.js
@@ -14,7 +14,12 @@ Search.prototype = $.extend({}, Navigation, new function() {
this.init = function() {
var _this = this;
- var observer = function() {
+ var observer = function(e) {
+ switch(e.originalEvent.keyCode) {
+ case 38: // Event.KEY_UP
+ case 40: // Event.KEY_DOWN
+ return;
+ }
_this.search(_this.$input[0].value);
};
this.$input.keyup(observer);
@@ -82,6 +87,8 @@ Search.prototype = $.extend({}, Navigation, new function() {
this.$input.attr('aria-activedescendant', $next.attr('id'));
this.scrollIntoView($next[0], this.$view[0]);
this.$current = $next;
+ this.$input.val($next[0].firstChild.firstChild.text);
+ this.$input.select();
}
return true;
}