Last active
April 13, 2016 08:54
-
-
Save alansemenov/1b5b22b0e0f4502075e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor() { | |
this.userIdInput = new api.ui.text.TextInput('input-view'); | |
this.userIdInput.setPlaceholder(_i18n('userid or e-mail')); | |
this.passwordInput = new api.ui.text.PasswordInput('input-view'); | |
this.passwordInput.setPlaceholder(_i18n('password')); | |
this.loginButton = new api.ui.button.Button(); | |
this.loginButton.addClass("login-button"); | |
this.loginButton.hide(); | |
var loginDiv = new api.dom.DivEl("password-container"); | |
loginDiv.appendChild(this.userIdInput); | |
loginDiv.appendChild(this.passwordInput); | |
loginDiv.appendChild(this.loginButton); | |
this.appendChild(loginDiv); | |
this.onShown((event) => { | |
this.userIdInput.giveFocus(); | |
}); | |
this.onSubmit((event) => { | |
if (this.userIdInput.getValue() && this.passwordInput.getValue()) { | |
this.submitForm(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment