From 9a9ef4867addd13c52a1b59bc757f20d3758379d Mon Sep 17 00:00:00 2001 From: Hoang Huu Date: Fri, 13 Sep 2019 15:22:59 +0700 Subject: [PATCH] Update --- assets/js/opalestate.js | 17 ++++++++--------- .../search-box/fields/search-city-text.php | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/assets/js/opalestate.js b/assets/js/opalestate.js index 65444889..c2ca71f3 100755 --- a/assets/js/opalestate.js +++ b/assets/js/opalestate.js @@ -300,15 +300,14 @@ jQuery( document ).ready( function ( $ ) { /** * Click to show body popup */ - $( 'body' ).delegate( '.opalestate-popup .popup-head', 'click', function () { - var $this = $( this ).parent( '.opalestate-popup' ); - $( '.popup-head', $this ).click( function () { - $( '.opalestate-popup.active' ).removeClass( 'active' ); - $this.toggleClass( 'active' ); - } ); - $( '.popup-close', $this ).click( function () { - $( '.opalestate-popup' ).removeClass( 'active' ); - } ); + $( '.popup-head' ).on( 'click', function ( e ) { + var $popup = $( this ).closest( '.opalestate-popup' ); + $popup.toggleClass( 'active' ); + } ); + + $( '.popup-close' ).on( 'click', function ( e ) { + var $popup = $( this ).closest( '.opalestate-popup' ); + $popup.removeClass( 'active' ); } ); /** diff --git a/templates/search-box/fields/search-city-text.php b/templates/search-box/fields/search-city-text.php index 0b6f88bb..7ead2f52 100755 --- a/templates/search-box/fields/search-city-text.php +++ b/templates/search-box/fields/search-city-text.php @@ -36,10 +36,10 @@ $data_deposit = [