Skip to content

Commit ce19cdd

Browse files
committed
Fixed issue with firstRun variable set to true when it should be false
1 parent 00ddbed commit ce19cdd

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jQuery Google Maps Store Locator - v3.1.10 - 2023-05-24
1+
/*! jQuery Google Maps Store Locator - v3.1.10 - 2023-05-31
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
33
* Copyright (c) 2023 Bjorn Holine; Licensed MIT */
44

@@ -285,7 +285,6 @@
285285
featuredset = [];
286286
normalset = [];
287287
markers = [];
288-
originalFilterVals = [];
289288
firstRun = false;
290289
$(document).off('click.'+pluginName, '.' + this.settings.locationList + ' li');
291290

@@ -2906,16 +2905,20 @@
29062905

29072906
openMap = $mapDiv.hasClass('bh-sl-map-open');
29082907

2909-
// Set a variable for fullMapStart so we can detect the first run
2908+
// Set a variable for fullMapStart, so we can detect the first run
29102909
if (
29112910
(_this.settings.fullMapStart === true && openMap === false) ||
29122911
(_this.settings.autoGeocode === true && openMap === false) ||
29132912
(_this.settings.defaultLoc === true && openMap === false)
29142913
) {
29152914
firstRun = true;
2916-
} else if (reload === true) {
2915+
} else if (
2916+
(_this.settings.fullMapStart === true && reload === true) ||
2917+
(_this.settings.autoGeocode === true && reload === true) ||
2918+
(_this.settings.defaultLoc === true && reload === true)
2919+
) {
2920+
//firstRun = true;
29172921
_this.reset();
2918-
firstRun = true;
29192922
} else {
29202923
_this.reset();
29212924
}

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ filtering.
3838
### Version 3.1.11
3939

4040
* Fixed issue with new disable filtering functionality with radio buttons.
41-
* Fixed issue with reset button where all locations were duplicated - introduced in v3.0.1
42-
* Updated functionality reset disabled form filters when Reset button is clicked.
41+
* Fixed issue with reset button where all locations were duplicated - introduced in v3.0.1.
42+
* Updated functionality to reset disabled form filters when Reset button is clicked.
4343

4444
### Version 3.1.10
4545

src/js/jquery.storelocator.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@
281281
featuredset = [];
282282
normalset = [];
283283
markers = [];
284-
originalFilterVals = [];
285284
firstRun = false;
286285
$(document).off('click.'+pluginName, '.' + this.settings.locationList + ' li');
287286

@@ -2902,16 +2901,19 @@
29022901

29032902
openMap = $mapDiv.hasClass('bh-sl-map-open');
29042903

2905-
// Set a variable for fullMapStart so we can detect the first run
2904+
// Set a variable for fullMapStart, so we can detect the first run
29062905
if (
29072906
(_this.settings.fullMapStart === true && openMap === false) ||
29082907
(_this.settings.autoGeocode === true && openMap === false) ||
29092908
(_this.settings.defaultLoc === true && openMap === false)
29102909
) {
29112910
firstRun = true;
2912-
} else if (reload === true) {
2911+
} else if (
2912+
(_this.settings.fullMapStart === true && reload === true) ||
2913+
(_this.settings.autoGeocode === true && reload === true) ||
2914+
(_this.settings.defaultLoc === true && reload === true)
2915+
) {
29132916
_this.reset();
2914-
firstRun = true;
29152917
} else {
29162918
_this.reset();
29172919
}

0 commit comments

Comments
 (0)