diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index eec2e5a2d0ef..3b75207e7435 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -173,8 +173,14 @@
  • diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js index 2350e698a062..63ad31f43871 100644 --- a/docs/src/templates/js/docs.js +++ b/docs/src/templates/js/docs.js @@ -138,6 +138,21 @@ docsApp.directive.focused = function($timeout) { }; }; +docsApp.directive.docsSearchInput = function() { + return function(scope, element, attrs) { + var ESCAPE_KEY_KEYCODE = 27; + element.bind('keydown', function(event) { + if(event.keyCode == ESCAPE_KEY_KEYCODE) { + event.stopPropagation(); + event.preventDefault(); + scope.$apply(function() { + scope.hideResults(); + }); + } + }); + }; +}; + docsApp.directive.code = function() { return { restrict:'E', terminal: true };