mirror of
https://github.com/nextcloud/passman.git
synced 2025-01-10 09:19:42 +08:00
22 lines
440 B
JavaScript
22 lines
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();
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
});
|