feat(auth): add an auto-focus directive and remove username placeholder
parent
851a1ac64c
commit
774738110b
|
@ -16,7 +16,7 @@
|
|||
<!-- username input -->
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></span>
|
||||
<input id="username" type="text" class="form-control" name="username" ng-model="formValues.Username" placeholder="admin" autofocus>
|
||||
<input id="username" type="text" class="form-control" name="username" ng-model="formValues.Username" auto-focus>
|
||||
</div>
|
||||
<!-- !username input -->
|
||||
<!-- password input -->
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<div class="form-group">
|
||||
<label for="password" class="col-sm-4 control-label text-left">Password</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" class="form-control" ng-model="formValues.Password" id="password">
|
||||
<input type="password" class="form-control" ng-model="formValues.Password" id="password" auto-focus>
|
||||
</div>
|
||||
</div>
|
||||
<!-- !new-password-input -->
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
angular
|
||||
.module('portainer')
|
||||
.directive('autoFocus', ['$timeout', function porAutoFocus($timeout) {
|
||||
var directive = {
|
||||
restrict: 'A',
|
||||
link: function($scope, $element) {
|
||||
$timeout(function() {
|
||||
$element[0].focus();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return directive;
|
||||
}]);
|
Loading…
Reference in New Issue