aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/src/templates/index.html6
-rw-r--r--docs/src/templates/js/docs.js16
2 files changed, 16 insertions, 6 deletions
diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html
index b40e9d31..3841846c 100644
--- a/docs/src/templates/index.html
+++ b/docs/src/templates/index.html
@@ -198,15 +198,15 @@
autocomplete="off" />
</form>
<div ng-show="hasResults" class="search-results">
- <a href="" ng-click="hideResults()" class="search-close">
- <span class="icon-remove-sign"></span>
- </a>
<div ng-repeat="(key, value) in results" class="search-group" ng-class="colClassName">
<h4>{{ key }}</h4>
<div ng-repeat="item in value" class="search-result">
<a ng-click="hideResults()" href="{{ item.url }}">{{ item.shortName }}</a>
</div>
</div>
+ <a href="" ng-click="hideResults()" class="search-close">
+ <span class="icon-remove-sign"></span>
+ </a>
</div>
</div>
</div>
diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js
index beec604b..fbabf193 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() {