blob: 621af631884b06e2f982b02b8d8cb39b8fce9e3c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
backupApp.directive('ngOnEnterPress', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress search", function (event) {
if (event.keyCode == 13 || event.type == "search") {
scope.$apply(function (){
scope.$eval(attrs.ngOnEnterPress);
});
event.preventDefault();
}
});
};
});
backupApp.directive('ngOnEscapePress', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress reset", function (event) {
if (event.keyCode == 27) {
scope.$apply(function (){
scope.$eval(attrs.ngOnEscapePress);
});
event.preventDefault();
}
});
};
});
|