Просмотр исходного кода

Use Angular 1.30 and only update emails on blur

James Allen 12 лет назад
Родитель
Сommit
f2066e46dd

+ 1 - 1
services/web/app/views/layout.jade

@@ -31,7 +31,7 @@ html(itemscope, itemtype='http://schema.org/Product')
 			window.csrfToken = "#{csrfToken}";
 
 		script(src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js")
-		script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js")
+		script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.14/angular.min.js")
 		
 	body
 		- if(typeof(suppressNavbar) == "undefined")

+ 2 - 1
services/web/app/views/user/login.jade

@@ -18,7 +18,8 @@ block content
 									name='email',
 									required,
 									placeholder='email@example.com',
-									ng-model="email"
+									ng-model="email",
+									ng-model-options="{ updateOn: 'blur' }"
 								)
 								span.small.text-primary(ng-show="loginForm.email.$invalid && loginForm.email.$dirty")
 									| Must be an email address

+ 2 - 1
services/web/app/views/user/register.jade

@@ -30,7 +30,8 @@ block content
 									placeholder="email@example.com"
 									required,
 									ng-model="email",
-									ng-init="email = #{JSON.stringify(new_email)}"
+									ng-init="email = #{JSON.stringify(new_email)}",
+									ng-model-options="{ updateOn: 'blur' }"
 								)
 								span.small.text-primary(ng-show="registerForm.email.$invalid && registerForm.email.$dirty")
 									| Must be an email address

+ 2 - 1
services/web/app/views/user/settings.jade

@@ -27,7 +27,8 @@ block content
 													placeholder="email@example.com"
 													required,
 													ng-model="email",
-													ng-init="email = #{JSON.stringify(user.email)}"
+													ng-init="email = #{JSON.stringify(user.email)}",
+													ng-model-options="{ updateOn: 'blur' }"
 												)
 												span.small.text-primary(ng-show="settingsForm.email.$invalid && settingsForm.email.$dirty")
 													| Must be an email address