mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-27 17:04:43 +08:00
24 lines
No EOL
481 B
JavaScript
24 lines
No EOL
481 B
JavaScript
(function () {
|
|
'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();
|
|
}
|
|
});
|
|
};
|
|
});
|
|
}()); |