mirror of
https://github.com/nextcloud/passman.git
synced 2024-12-28 02:44:14 +08:00
22 lines
No EOL
440 B
JavaScript
22 lines
No EOL
440 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* @ngdoc directive
|
|
* @name passmanApp.directive:passwordGen
|
|
* @description
|
|
* # passwordGen
|
|
*/
|
|
angular.module('passmanApp')
|
|
.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();
|
|
}
|
|
});
|
|
};
|
|
}); |