Fix login form

This commit is contained in:
Paulus Schoutsen 2017-06-20 21:06:57 -07:00
parent f177c0eb9f
commit e2e02acf30
2 changed files with 12 additions and 17 deletions

View File

@ -4,8 +4,7 @@
<link rel="import" href="../../bower_components/paper-checkbox/paper-checkbox.html"> <link rel="import" href="../../bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" href="../../bower_components/paper-button/paper-button.html"> <link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../bower_components/paper-input/paper-input-container.html"> <link rel="import" href="../../bower_components/paper-input/paper-input.html">
<link rel="import" href="../../bower_components/paper-input/paper-input-error.html">
<link rel="import" href="../../bower_components/iron-input/iron-input.html"> <link rel="import" href="../../bower_components/iron-input/iron-input.html">
<link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html"> <link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html">
@ -17,7 +16,7 @@
white-space: nowrap; white-space: nowrap;
} }
#passwordDecorator { paper-input {
display: block; display: block;
margin-bottom: 16px; margin-bottom: 16px;
} }
@ -49,19 +48,14 @@
<a href="#" id="hideKeyboardOnFocus"></a> <a href="#" id="hideKeyboardOnFocus"></a>
<div class='interact'> <div class='interact'>
<div id='loginform' hidden$="[[showSpinner]]"> <div id='loginform' hidden$="[[showSpinner]]">
<paper-input-container <paper-input
id="passwordDecorator" id='passwordInput'
invalid="[[errorMessage]]" label='Password'
> type='password'
<label>Password</label> invalid='[[errorMessage]]'
<input error-message='[[errorMessage]]'
is="iron-input" value='{{password}}'
type="password" ></paper-input>
id="passwordInput"
bind-value="{{password}}"
/>
<paper-input-error invalid="[[errorMessage]]">[[errorMessage]]</paper-input-error>
</paper-input-container>
<div class="layout horizontal center"> <div class="layout horizontal center">
<paper-checkbox for id='rememberLogin'>Remember</paper-checkbox> <paper-checkbox for id='rememberLogin'>Remember</paper-checkbox>
<paper-button id='loginButton'>Log In</paper-button> <paper-button id='loginButton'>Log In</paper-button>
@ -138,7 +132,7 @@ Polymer({
isValidatingChanged: function (newVal) { isValidatingChanged: function (newVal) {
if (!newVal) { if (!newVal) {
this.async(function () { this.async(function () {
this.$.passwordInput.focus(); this.$.passwordInput.inputElement.inputElement.focus();
}.bind(this), 10); }.bind(this), 10);
} }
}, },

View File

@ -67,6 +67,7 @@
<paper-input <paper-input
label='[[item.name]]' label='[[item.name]]'
name='[[item.id]]' name='[[item.id]]'
type='[[item.type]]'
on-change='fieldChanged' on-change='fieldChanged'
></paper-input> ></paper-input>
</template> </template>