chore(docs): use $document[0]

This commit is contained in:
sathify
2014-09-03 13:37:50 -07:00
committed by Martin Staffa
parent b28f1fc3fb
commit a48f64162d
+2 -2
View File
@@ -202,13 +202,13 @@ angular.module('search', [])
};
})
.directive('docsSearchInput', ['$document',function($document) {
.directive('docsSearchInput', ['$document', function($document) {
return function(scope, element, attrs) {
var ESCAPE_KEY_KEYCODE = 27,
FORWARD_SLASH_KEYCODE = 191;
angular.element($document[0].body).on('keydown', function(event) {
var input = element[0];
if (event.keyCode === FORWARD_SLASH_KEYCODE && window.document.activeElement !== input) {
if (event.keyCode === FORWARD_SLASH_KEYCODE && $document[0].activeElement !== input) {
event.stopPropagation();
event.preventDefault();
input.focus();