Skip to content

Commit

Permalink
Merge pull request #29 from hivepress/hotfix
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
hivepress committed Jul 24, 2022
2 parents 0cfe038 + 8941b2f commit 8e9b3f4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
14 changes: 2 additions & 12 deletions assets/js/common.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
(function($) {
'use strict';

hivepress.initGeolocation = function(container = null) {
if (container === null) {
container = $('body');
}
hivepress.initGeolocation = function(container) {

// Location
container.find(hivepress.getSelector('location')).each(function() {
Expand Down Expand Up @@ -315,13 +312,6 @@
}

$(document).on('hivepress:init', function(event, container) {
if (!container.is('body')) {
hivepress.initGeolocation(container);
}
hivepress.initGeolocation(container);
});

// Mapbox
if (typeof mapboxData !== 'undefined') {
hivepress.initGeolocation();
}
})(jQuery);
2 changes: 1 addition & 1 deletion assets/js/common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hivepress-geolocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: HivePress Geolocation
* Description: Allow users to search listings by location.
* Version: 1.3.6
* Version: 1.3.7
* Author: HivePress
* Author URI: https://hivepress.io/
* Text Domain: hivepress-geolocation
Expand Down
4 changes: 0 additions & 4 deletions includes/components/class-geolocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ public function enqueue_scripts() {
'https://maps.googleapis.com/maps/api/js?' . http_build_query(
[
'libraries' => 'places',
'callback' => 'hivepress.initGeolocation',
'key' => get_option( 'hp_gmaps_api_key' ),
'language' => hivepress()->translator->get_language(),
'region' => hivepress()->translator->get_region(),
Expand All @@ -251,9 +250,6 @@ public function enqueue_scripts() {
null,
true
);

wp_script_add_data( 'google-maps', 'async', true );
wp_script_add_data( 'google-maps', 'defer', true );
}
}

Expand Down

0 comments on commit 8e9b3f4

Please sign in to comment.