Autofocus on first field in signup form

This commit is contained in:
Neil Lalonde 2013-03-13 17:59:24 -04:00
parent 21b5183d6a
commit 7777b3f650
2 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<tr>
<td style="width:80px"><label for='new-account-name'>{{i18n user.name.title}}</label></td>
<td style="width:496px">
{{view Ember.TextField valueBinding="view.accountName" elementId="new-account-name"}}
{{view Discourse.TextField valueBinding="view.accountName" elementId="new-account-name" autofocus="autofocus"}}
&nbsp;{{view Discourse.InputTipView validationBinding="view.nameValidation"}}
</td>
</tr>

View File

@ -10,7 +10,11 @@ Discourse.TextField = Ember.TextField.extend({
attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus'],
placeholder: (function() {
return Em.String.i18n(this.get('placeholderKey'));
if( this.get('placeholderKey') ) {
return Em.String.i18n(this.get('placeholderKey'));
} else {
return '';
}
}).property('placeholderKey')
});