Fix login ajax.

This commit is contained in:
Hoang Huu 2019-12-04 17:12:08 +07:00
parent 40f1928b69
commit a0d9b9f0c7
2 changed files with 8 additions and 11 deletions

View File

@ -1,8 +1,4 @@
jQuery( document ).ready( function ( $ ) { jQuery( document ).ready( function ( $ ) {
/**
*
*/
$( '#show-user-sidebar-btn' ).click( function () { $( '#show-user-sidebar-btn' ).click( function () {
$( 'body' ).toggleClass( 'active' ); $( 'body' ).toggleClass( 'active' );
} ); } );
@ -313,8 +309,7 @@ jQuery( document ).ready( function ( $ ) {
/** /**
* Login form * Login form
**/ **/
$( 'body' ).delegate( '.opalestate-mfp-popup form.opalestate-login-form', 'submit', function () { $( 'form.opalestate-login-form' ).on( 'submit', function () {
var $form = $( this ); var $form = $( this );
$.ajax( { $.ajax( {
type: 'POST', type: 'POST',
@ -331,17 +326,15 @@ jQuery( document ).ready( function ( $ ) {
$form.find( '.opalestate-notice' ).remove(); $form.find( '.opalestate-notice' ).remove();
$form.prepend( data.message ); $form.prepend( data.message );
} }
} }
} ); } );
return false; return false;
} ); } );
/** /**
* Login form * Register form
**/ **/
$( 'body' ).delegate( '.opalestate-mfp-popup form.opalestate-register-form', 'submit', function () { $( 'form.opalestate-register-form' ).on( 'submit', function () {
var $form = $( this ); var $form = $( this );
$.ajax( { $.ajax( {
type: 'POST', type: 'POST',
@ -358,11 +351,11 @@ jQuery( document ).ready( function ( $ ) {
$form.find( '.opalestate-notice' ).remove(); $form.find( '.opalestate-notice' ).remove();
$form.prepend( data.message ); $form.prepend( data.message );
} }
} }
} ); } );
return false; return false;
} ); } );
/** /**
* AJAX ACTION * AJAX ACTION
*/ */

View File

@ -3997,3 +3997,7 @@ header#masthead {
background: #2f73e9; background: #2f73e9;
position: absolute; position: absolute;
top: 0; } top: 0; }
.opalestate-notice {
padding: 10px;
}