Skip to content

Commit b9e4b4a

Browse files
committed
Fixed potential error from occurring if fullMapStartListLimit is set and the number of locations is less than the limit
1 parent a485a63 commit b9e4b4a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jQuery Google Maps Store Locator - v3.1.2 - 2021-01-12
1+
/*! jQuery Google Maps Store Locator - v3.1.2 - 2021-03-27
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
33
* Copyright (c) 2021 Bjorn Holine; Licensed MIT */
44

@@ -3066,7 +3066,7 @@
30663066
locList.empty();
30673067

30683068
// Set up the location list markup
3069-
if (firstRun && _this.settings.fullMapStartListLimit !== false && !isNaN(_this.settings.fullMapStartListLimit) && _this.settings.fullMapStartListLimit !== -1) {
3069+
if (firstRun && _this.settings.fullMapStartListLimit !== false && !isNaN(_this.settings.fullMapStartListLimit) && _this.settings.fullMapStartListLimit !== -1 && markers.length > _this.settings.fullMapStartListLimit) {
30703070
for (var m = 0; m < _this.settings.fullMapStartListLimit; m++) {
30713071
var currentMarker = markers[m];
30723072
_this.listSetup(currentMarker, storeStart, page);

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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ filtering.
3535

3636
## Changelog
3737

38+
### Version 3.1.3
39+
40+
* Fixed potential error from occurring if fullMapStartListLimit is set and the number of locations is less than the limit.
41+
3842
### Version 3.1.2
3943

4044
* Fixed name search issue introduced in v3.1.1. Reverted to previous matching pattern only for name searches and still using the new patter for taxonomy matching.

src/js/jquery.storelocator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3062,7 +3062,7 @@
30623062
locList.empty();
30633063

30643064
// Set up the location list markup
3065-
if (firstRun && _this.settings.fullMapStartListLimit !== false && !isNaN(_this.settings.fullMapStartListLimit) && _this.settings.fullMapStartListLimit !== -1) {
3065+
if (firstRun && _this.settings.fullMapStartListLimit !== false && !isNaN(_this.settings.fullMapStartListLimit) && _this.settings.fullMapStartListLimit !== -1 && markers.length > _this.settings.fullMapStartListLimit) {
30663066
for (var m = 0; m < _this.settings.fullMapStartListLimit; m++) {
30673067
var currentMarker = markers[m];
30683068
_this.listSetup(currentMarker, storeStart, page);

0 commit comments

Comments
 (0)