Skip to content

Commit

Permalink
focus the username field when the panel is popped open to the login pane
Browse files Browse the repository at this point in the history
  • Loading branch information
ianloic committed Jul 28, 2008
1 parent 6a28e8a commit 4c41507
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions chrome/content/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ Lastfm.onLoad = function() {
this._scrobble.addEventListener('command',
function(event) { Lastfm.toggleShouldScrobble(); }, false);

// the popupshown event on the panel
this._panel.addEventListener('popupshown',
function(event) {
if (Lastfm._deck.selectedPanel == Lastfm._login) {
// if the login panel is showing then focus & select the username
// field
Lastfm._username.focus();
Lastfm._username.select();
}
}, false);

// copy the username & password out of the service into the UI
this._username.value = this._service.username;
this._password.value = this._service.password;
Expand Down

0 comments on commit 4c41507

Please sign in to comment.