Skip to content

Commit

Permalink
Merge pull request #59 from ronichoudhury-work/login-autofocus
Browse files Browse the repository at this point in the history
Auto-focus username field when login dialog appears
  • Loading branch information
Roni Choudhury authored Mar 10, 2017
2 parents 63233fe + 0ba3a1b commit 296af47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions web_external/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ observeStore(next => {

case appMode.loginDialog:
switchOverlay('login-dialog');
loginDialog.focusUsername();
break;

case appMode.startScreen:
Expand Down
6 changes: 6 additions & 0 deletions web_external/view/overlay/LoginDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class LoginDialog {
this.el.select('#passwordfield').on('keydown', enter);
}

focusUsername () {
this.el.select('#loginfield')
.node()
.focus();
}

submit () {
const username = this.el.select('#loginfield').property('value');
const password = this.el.select('#passwordfield').property('value');
Expand Down

0 comments on commit 296af47

Please sign in to comment.