diff --git a/ghost/admin/app/controllers/setup/two.js b/ghost/admin/app/controllers/setup/two.js index 3cc2cfaf33..1c0be7c3ea 100644 --- a/ghost/admin/app/controllers/setup/two.js +++ b/ghost/admin/app/controllers/setup/two.js @@ -49,6 +49,16 @@ export default Ember.Controller.extend(ValidationEngine, { }, actions: { + preValidate: function (model) { + var self = this; + if (this.get(model)) { + if (model === 'email') { + self.send('handleEmail'); + } + this.validate({property: model}); + } + }, + setup: function () { var self = this, data = self.getProperties('blogTitle', 'name', 'email', 'password', 'image'), diff --git a/ghost/admin/app/templates/setup/two.hbs b/ghost/admin/app/templates/setup/two.hbs index 1729d057ed..3de65d556e 100644 --- a/ghost/admin/app/templates/setup/two.hbs +++ b/ghost/admin/app/templates/setup/two.hbs @@ -11,28 +11,28 @@ {{#gh-form-group errors=errors property="email"}} - {{gh-trim-focus-input tabindex="1" type="email" name="email" placeholder="Eg. john@example.com" autocorrect="off" value=email focusOut=(action "handleEmail")}} + {{gh-trim-focus-input tabindex="1" type="email" name="email" placeholder="Eg. john@example.com" autocorrect="off" value=email focusOut=(action "preValidate" "email")}} {{gh-error-message errors=errors property="email"}} {{/gh-form-group}} {{#gh-form-group errors=errors property="name"}} - {{gh-input tabindex="2" type="text" name="name" placeholder="Eg. John H. Watson" autocorrect="off" value=name focusOut=(action "validate" "name")}} + {{gh-input tabindex="2" type="text" name="name" placeholder="Eg. John H. Watson" autocorrect="off" value=name focusOut=(action "preValidate" "name")}} {{gh-error-message errors=errors property="name"}} {{/gh-form-group}} {{#gh-form-group errors=errors property="password"}} - {{gh-input tabindex="3" type="password" name="password" placeholder="At least 8 characters" autocorrect="off" value=password focusOut=(action "validate" "password")}} + {{gh-input tabindex="3" type="password" name="password" placeholder="At least 8 characters" autocorrect="off" value=password focusOut=(action "preValidate" "password")}} {{gh-error-message errors=errors property="password"}} {{/gh-form-group}} {{#gh-form-group errors=errors property="blogTitle"}} - {{gh-input tabindex="4" type="text" name="blog-title" placeholder="Eg. The Daily Awesome" autocorrect="off" value=blogTitle focusOut=(action "validate" "blogTitle")}} + {{gh-input tabindex="4" type="text" name="blog-title" placeholder="Eg. The Daily Awesome" autocorrect="off" value=blogTitle focusOut=(action "preValidate" "blogTitle")}} {{gh-error-message errors=errors property="blogTitle"}} {{/gh-form-group}}