Skip to content

Commit

Permalink
Login form focus and submit
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Antoine Mathieu committed Sep 28, 2020
1 parent 70690c9 commit 43ef1f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions webapp/js/ctrl/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
plik.controller('LoginCtrl', ['$scope', '$api', '$config', '$location', '$dialog',
function ($scope, $api, $config, $location, $dialog) {

// Ugly but it works
setTimeout(function () {
$("#login").focus();
}, 100);

// Get server config
$config.getConfig()
.then(function (config) {
Expand Down
8 changes: 5 additions & 3 deletions webapp/partials/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<div class="col-sm-12 text-center">
<div class="row">
<div class="col-sm-11 col-sm-offset-1">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="login()">
<!-- needed for ng-submit to work -->
<input type="submit" id="submit" style="display:none"/>

<!-- LOGIN INPUT -->
<div class="form-group">
<label for="login" class="col-sm-2 control-label">Login</label>
Expand All @@ -20,8 +23,7 @@
<div class="form-group">
<label for="password" class="col-sm-2 control-label">Password</label>
<div class="col-sm-8">
<input id="password" type="password" ng-model="$parent.password" class="form-control"
placeholder="Password">
<input id="password" type="password" ng-model="$parent.password" class="form-control" placeholder="Password">
</div>
</div>
</form>
Expand Down

0 comments on commit 43ef1f2

Please sign in to comment.