mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
17 lines
355 B
JavaScript
17 lines
355 B
JavaScript
'use strict';
|
|
|
|
angular.module('etcdControlPanel')
|
|
.directive('ngEnter', function() {
|
|
return function(scope, element, attrs) {
|
|
element.bind('keydown keypress', function(event) {
|
|
if(event.which === 13) {
|
|
scope.$apply(function(){
|
|
scope.$eval(attrs.ngEnter);
|
|
});
|
|
|
|
event.preventDefault();
|
|
}
|
|
});
|
|
};
|
|
});
|