portainer/app/directives/autofocus.js

15 lines
282 B
JavaScript
Raw Normal View History

angular
.module('portainer')
.directive('autoFocus', ['$timeout', function porAutoFocus($timeout) {
var directive = {
restrict: 'A',
link: function($scope, $element) {
$timeout(function() {
$element[0].focus();
});
}
};
return directive;
}]);