Skip to content

Commit 48ae712

Browse files
committed
Fixed issue with featuredLocations setting where featured locations at far distances would trigger distance alert
1 parent 4849510 commit 48ae712

File tree

4 files changed

+36
-35
lines changed

4 files changed

+36
-35
lines changed

dist/assets/js/plugins/storeLocator/jquery.storelocator.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,23 +2491,6 @@
24912491
_this.sortNumerically(locationset);
24922492
}
24932493

2494-
// Featured locations filtering
2495-
if (_this.settings.featuredLocations === true) {
2496-
// Create array for featured locations
2497-
featuredset = $.grep(locationset, function (val) {
2498-
return val.featured === 'true';
2499-
});
2500-
2501-
// Create array for normal locations
2502-
normalset = $.grep(locationset, function (val) {
2503-
return val.featured !== 'true';
2504-
});
2505-
2506-
// Combine the arrays
2507-
locationset = [];
2508-
locationset = featuredset.concat(normalset);
2509-
}
2510-
25112494
// Check the closest marker
25122495
if (_this.isEmptyObject(taxFilters)) {
25132496
if (_this.settings.maxDistance === true && maxDistance) {
@@ -2528,6 +2511,23 @@
25282511
}
25292512
}
25302513

2514+
// Featured locations filtering
2515+
if (_this.settings.featuredLocations === true) {
2516+
// Create array for featured locations
2517+
featuredset = $.grep(locationset, function (val) {
2518+
return val.featured === 'true';
2519+
});
2520+
2521+
// Create array for normal locations
2522+
normalset = $.grep(locationset, function (val) {
2523+
return val.featured !== 'true';
2524+
});
2525+
2526+
// Combine the arrays
2527+
locationset = [];
2528+
locationset = featuredset.concat(normalset);
2529+
}
2530+
25312531
// Slide in the map container
25322532
if (_this.settings.slideMap === true) {
25332533
$this.slideDown();

dist/assets/js/plugins/storeLocator/jquery.storelocator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ filtering.
3939

4040
* Added callbackAutoGeoSuccess callback that fires after the geolocation API returns a successful result.
4141
* Added callbackFormVals callback that fires after the form values have been processed from the form.
42+
* Fixed issue with featuredLocations setting where featured locations at far distances would trigger distance alert.
4243
* Fixed issue where HTML5 Geolocation was skipped when using the fullMapStartBlank setting.
4344
* Fixed issue with taxonomy filtering and autoGeocode setting where HTML Geocoding API would run on every filter change.
4445
* Swapped the default location data type to be JSON instead of XML.

src/js/jquery.storelocator.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,23 +2487,6 @@
24872487
_this.sortNumerically(locationset);
24882488
}
24892489

2490-
// Featured locations filtering
2491-
if (_this.settings.featuredLocations === true) {
2492-
// Create array for featured locations
2493-
featuredset = $.grep(locationset, function (val) {
2494-
return val.featured === 'true';
2495-
});
2496-
2497-
// Create array for normal locations
2498-
normalset = $.grep(locationset, function (val) {
2499-
return val.featured !== 'true';
2500-
});
2501-
2502-
// Combine the arrays
2503-
locationset = [];
2504-
locationset = featuredset.concat(normalset);
2505-
}
2506-
25072490
// Check the closest marker
25082491
if (_this.isEmptyObject(taxFilters)) {
25092492
if (_this.settings.maxDistance === true && maxDistance) {
@@ -2524,6 +2507,23 @@
25242507
}
25252508
}
25262509

2510+
// Featured locations filtering
2511+
if (_this.settings.featuredLocations === true) {
2512+
// Create array for featured locations
2513+
featuredset = $.grep(locationset, function (val) {
2514+
return val.featured === 'true';
2515+
});
2516+
2517+
// Create array for normal locations
2518+
normalset = $.grep(locationset, function (val) {
2519+
return val.featured !== 'true';
2520+
});
2521+
2522+
// Combine the arrays
2523+
locationset = [];
2524+
locationset = featuredset.concat(normalset);
2525+
}
2526+
25272527
// Slide in the map container
25282528
if (_this.settings.slideMap === true) {
25292529
$this.slideDown();

0 commit comments

Comments
 (0)