fixed the alert problem and another bug I found at sign in
This commit is contained in:
parent
8be8bb9f26
commit
d1fd6de671
@ -336,11 +336,12 @@ NGApp.controller('AppController', function ($scope, $route, $routeParams, $rootS
|
||||
|
||||
});
|
||||
|
||||
App.alert = function(txt, title) {
|
||||
App.alert = function( txt, title, useNativeAlert ) {
|
||||
setTimeout(function() {
|
||||
// @todo: #1546
|
||||
if (App.useNativeAlert && App.isPhoneGap) {
|
||||
if (useNativeAlert && App.isPhoneGap) {
|
||||
navigator.notification.alert(txt, null, title || 'Crunchbutton');
|
||||
} else if ( useNativeAlert ) {
|
||||
alert( txt );
|
||||
} else {
|
||||
App.rootScope.$broadcast('notificationAlert', title || null, txt);
|
||||
}
|
||||
|
||||
@ -42,13 +42,13 @@ NGApp.factory( 'AccountService', function( $http, $rootScope, PositionsService )
|
||||
|
||||
service.signin = function(){
|
||||
if( !service.isValidEmailPhone() ){
|
||||
alert( 'Please enter a valid email or phone.' );
|
||||
App.alert( 'Please enter a valid email or phone.', null, true );
|
||||
$rootScope.focus( '.signin-email' );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !service.isValidPassword() ){
|
||||
alert( 'Please enter your password.' );
|
||||
App.alert( 'Please enter your password.', null, true );
|
||||
$rootScope.focus( '.signin-password' );
|
||||
return;
|
||||
}
|
||||
@ -83,13 +83,13 @@ NGApp.factory( 'AccountService', function( $http, $rootScope, PositionsService )
|
||||
|
||||
service.signup = function(){
|
||||
if( !service.isValidEmailPhone() ){
|
||||
alert( 'Please enter a valid email or phone.' );
|
||||
App.alert( 'Please enter a valid email or phone.', null, true );
|
||||
$rootScope.focus( '.signup-email' );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !service.isValidPassword() ){
|
||||
App.alert( 'Please enter a password.' );
|
||||
App.alert( 'Please enter a password.', null, true );
|
||||
$rootScope.focus( '.signup-password' );
|
||||
return;
|
||||
}
|
||||
@ -161,7 +161,10 @@ NGApp.factory( 'AccountService', function( $http, $rootScope, PositionsService )
|
||||
}
|
||||
|
||||
service.isValidPassword = function(){
|
||||
return service.password != '';
|
||||
if( service.form.password ){
|
||||
return service.form.password != '';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return service;
|
||||
@ -204,7 +207,7 @@ NGApp.factory( 'AccountHelpService', function( $http, $rootScope, AccountService
|
||||
|
||||
service.sendForm = function(){
|
||||
if( !account.isValidEmailPhone() ){
|
||||
alert( 'Please enter a valid email or phone.' );
|
||||
App.alert( 'Please enter a valid email or phone.', null, true );
|
||||
$rootScope.focus( '.help-email' );
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user