mirror of
https://github.com/duplicati/duplicati.git
synced 2025-11-28 11:30:24 +08:00
25 lines
880 B
JavaScript
25 lines
880 B
JavaScript
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();
|
|
}
|
|
});
|
|
};
|
|
});
|