From 630f0dd573fea04da2a59d83f4af3a5b0d6e8ed0 Mon Sep 17 00:00:00 2001 From: Hoang Huu Date: Thu, 30 Jan 2020 10:20:37 +0700 Subject: [PATCH] Fix archive filter --- assets/js/frontend/googlemaps.js | 19 +++++++++++++++---- opal-estate-pro.php | 7 +++---- readme.txt | 5 ++++- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/assets/js/frontend/googlemaps.js b/assets/js/frontend/googlemaps.js index 119f4e3e..bdbefe2b 100755 --- a/assets/js/frontend/googlemaps.js +++ b/assets/js/frontend/googlemaps.js @@ -1544,15 +1544,19 @@ // // Sortable Change // // $( 'body' ).delegate( '#opalestate-sortable-form select', 'change', function () { - var ps = ''; if ( $( 'form.opalestate-search-form' ).length > 0 ) { var $form = $( 'form.opalestate-search-form' ); - var ps = $form.serialize() + '&opalsortable=' + $( this ).val() + '&display=' + - $( '.display-mode a.active' ).data( 'mode' ); + if ( $('body').hasClass( 'archive' ) ) { + ps = 'opalsortable=' + $( this ).val() + '&display=' + + $( '.display-mode a.active' ).data( 'mode' ); + } else { + ps = $form.serialize() + '&opalsortable=' + $( this ).val() + '&display=' + + $( '.display-mode a.active' ).data( 'mode' ); + } } - if ( $( '.opalesate-properties-results' ) && ps ) { + if ( $( '.opalesate-properties-results' ).length > 0 && ps ) { if ( history.pushState ) { var newurl = window.location.protocol + '//' + window.location.host + window.location.pathname + '?' + ps; @@ -1560,9 +1564,16 @@ updatePropertiesByParseringHtml( newurl ); } } else { + if ( history.pushState && $('body').hasClass( 'archive' ) ) { + var newurl = window.location.protocol + '//' + window.location.host + window.location.pathname + + '?' + ps; + window.history.pushState( { path: newurl }, '', newurl ); + } + $( '#opalestate-sortable-form' ).submit(); } } ); + // display mode $( 'body' ).delegate( '.display-mode a', 'click', function () { if ( $( '.opalesate-properties-results' ).length > 0 ) { diff --git a/opal-estate-pro.php b/opal-estate-pro.php index 20e80a2d..4ab9fda2 100755 --- a/opal-estate-pro.php +++ b/opal-estate-pro.php @@ -3,7 +3,7 @@ * Plugin Name: Opal Estate Pro * Plugin URI: https://wpdocs.gitbook.io/opal-estate/ * Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website. - * Version: 1.2.9.1 + * Version: 1.2.9.2 * Author: WPOPAL * Author URI: http://www.wpopal.com * Requires at least: 4.9 @@ -146,12 +146,11 @@ if ( ! class_exists( 'OpalEstate' ) ) { * The whole idea of the singleton design pattern is that there is a single * object, therefore we don't want the object to be cloned. * - * @return void * @access protected */ public function __clone() { // Cloning instances of the class is forbidden - _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.2.9.1' ); + _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.2.9.2' ); } /** @@ -160,7 +159,7 @@ if ( ! class_exists( 'OpalEstate' ) ) { public function setup_constants() { // Plugin version if ( ! defined( 'OPALESTATE_VERSION' ) ) { - define( 'OPALESTATE_VERSION', '1.2.9.1' ); + define( 'OPALESTATE_VERSION', '1.2.9.2' ); } // Plugin Folder Path diff --git a/readme.txt b/readme.txt index 7b9ef6ca..4792b1cb 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://wpdocs.gitbook.io/opal-estate/ Tags: estate, property, opalestate, house for rent, agency for lease, estate submission, agents estate property, property marketplace Requires at least: 4.9 Tested up to: 5.3.2 -Stable tag: 1.2.9.1 +Stable tag: 1.2.9.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -156,6 +156,9 @@ This section describes how to install the plugin and get it working. * System tickets support 24/7 available : [free support](https://wpopal.ticksy.com/ "Visit the Plugin support Page") == Changelog == += 1.2.9.2 - 2020-01-30 = +* Fixes - Archive filter. + = 1.2.9.1 - 2020-01-13 = * Added - Pages settings.