diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index b40e9d3106f8..3841846c9ea3 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -198,15 +198,15 @@ autocomplete="off" />
diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js index beec604b5a67..fbabf19350a1 100644 --- a/docs/src/templates/js/docs.js +++ b/docs/src/templates/js/docs.js @@ -132,9 +132,19 @@ docsApp.directive.focused = function($timeout) { }; }; -docsApp.directive.docsSearchInput = function() { +docsApp.directive.docsSearchInput = ['$document',function($document) { return function(scope, element, attrs) { - var ESCAPE_KEY_KEYCODE = 27; + var ESCAPE_KEY_KEYCODE = 27, + FORWARD_SLASH_KEYCODE = 191; + angular.element($document[0].body).bind('keydown', function(event) { + var input = element[0]; + if(event.keyCode == FORWARD_SLASH_KEYCODE && document.activeElement != input) { + event.stopPropagation(); + event.preventDefault(); + input.focus(); + } + }); + element.bind('keydown', function(event) { if(event.keyCode == ESCAPE_KEY_KEYCODE) { event.stopPropagation(); @@ -145,7 +155,7 @@ docsApp.directive.docsSearchInput = function() { } }); }; -}; +}]; docsApp.directive.code = function() {