use native alert function
This commit is contained in:
parent
dc33f84158
commit
06fcf167b4
@ -37,13 +37,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.' );
|
||||
$( '.signin-email' ).focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if( !service.isValidPassword() ){
|
||||
alert( 'Please enter your password.' );
|
||||
App.alert( 'Please enter your password.' );
|
||||
$( '.signin-password' ).focus();
|
||||
return;
|
||||
}
|
||||
@ -78,13 +78,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.' );
|
||||
$( '.signup-email' ).focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if( !service.isValidPassword() ){
|
||||
alert( 'Please enter a password.' );
|
||||
App.alert( 'Please enter a password.' );
|
||||
$( '.signup-password' ).focus();
|
||||
return;
|
||||
}
|
||||
@ -196,7 +196,7 @@ NGApp.factory( 'AccountHelpService', function( $http, AccountService, AccountMod
|
||||
|
||||
service.sendForm = function(){
|
||||
if( !account.isValidEmailPhone() ){
|
||||
alert( 'Please enter a valid email or phone.' );
|
||||
App.alert( 'Please enter a valid email or phone.' );
|
||||
$( '.help-email' ).focus();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ NGApp.factory( 'FacebookService', function( $http, $location, $rootScope, Accoun
|
||||
service.postOrder = function(){
|
||||
if( !service.orderStatus ){
|
||||
service.preLoadOrderStatus();
|
||||
alert( 'Oops, please try again!' );
|
||||
App.alert( 'Oops, please try again!' );
|
||||
return;
|
||||
}
|
||||
var status = service.orderStatus;
|
||||
|
||||
@ -17,7 +17,7 @@ NGApp.factory( 'RecommendRestaurantService', function( $http, PositionsService,
|
||||
|
||||
service.send = function(){
|
||||
if ( service.form.restaurant == '' ){
|
||||
alert( "Please enter the restaurant\'s name." );
|
||||
App.alert( "Please enter the restaurant\'s name." );
|
||||
$( '.recommend-restaurant' ).focus();
|
||||
return;
|
||||
}
|
||||
@ -93,7 +93,7 @@ NGApp.factory( 'RecommendFoodService', function( $http, $routeParams ){
|
||||
service.send = function(){
|
||||
service.form.name = $.trim( service.form.name );
|
||||
if ( service.form.name == '' ){
|
||||
alert( 'Please enter a suggestion.' );
|
||||
App.alert( 'Please enter a suggestion.' );
|
||||
$('#suggestion-name').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -36,25 +36,25 @@ NGApp.factory( 'SupportService', function( $http, AccountService ){
|
||||
service.purify();
|
||||
|
||||
if ( service.form.name == '' ){
|
||||
alert( 'Please enter your name.' );
|
||||
App.alert( 'Please enter your name.' );
|
||||
$('input[name=support-name]').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( service.form.phone == '' ){
|
||||
alert( 'Please enter your phone.' );
|
||||
App.alert( 'Please enter your phone.' );
|
||||
$('input[name=support-phone]').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !App.phone.validate( service.form.phone ) ) {
|
||||
alert( 'Please enter a valid phone.' );
|
||||
App.alert( 'Please enter a valid phone.' );
|
||||
$('input[name=support-phone]').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( service.form.message == '' ){
|
||||
alert( 'Please enter the message.' );
|
||||
App.alert( 'Please enter the message.' );
|
||||
$('textarea[name=support-message]').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user