Skip to content

Commit 4f98ae9

Browse files
committed
Merge branch 'master' into development
2 parents d44d2a4 + d87118b commit 4f98ae9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/js/jquery.storelocator.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111

1212
// Variables used across multiple methods
13-
var $this, listTemplate, infowindowTemplate, dataTypeRead, originalOrigin, originalData, originalZoom, dataRequest, searchInput, addressInput, olat, olng, storeNum, directionsDisplay, directionsService, prevSelectedMarkerBefore, prevSelectedMarkerAfter;
13+
var $this, listTemplate, infowindowTemplate, dataTypeRead, originalOrigin, originalData, originalZoom, dataRequest, searchInput, addressInput, olat, olng, storeNum, directionsDisplay, directionsService, prevSelectedMarkerBefore, prevSelectedMarkerAfter, firstRun;
1414
var featuredset = [], locationset = [], normalset = [], markers = [];
1515
var filters = {}, locationData = {}, GeoCodeCalc = {}, mappingObj = {};
1616

@@ -240,6 +240,7 @@
240240
featuredset = [];
241241
normalset = [];
242242
markers = [];
243+
firstRun = false;
243244
$(document).off('click.'+pluginName, '.' + this.settings.locationList + ' li');
244245
if( $('.' + this.settings.locationList + ' .bh-sl-close-directions-container').length ) {
245246
$('.bh-sl-close-directions-container').remove();
@@ -938,7 +939,7 @@
938939
}
939940

940941
// Create the default markers
941-
if (this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || this.settings.catMarkers !== null || this.settings.markerImg !== null) {
942+
if (this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || this.settings.catMarkers !== null || this.settings.markerImg !== null || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
942943
marker = new google.maps.Marker({
943944
position : point,
944945
map : map,
@@ -998,7 +999,7 @@
998999
// Set up alpha character
9991000
var markerId = currentMarker.get('id');
10001001
// Use dot markers instead of alpha if there are more than 26 locations
1001-
if (this.settings.storeLimit === -1 || this.settings.storeLimit > 26) {
1002+
if (this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
10021003
indicator = markerId + 1;
10031004
}
10041005
else {
@@ -1403,11 +1404,10 @@
14031404
* @param data {Object} location data object
14041405
* @param lat {number} origin latitude
14051406
* @param lng {number} origin longitude
1406-
* @param firstRun {boolean} initial load check
14071407
* @param origin {string} origin address
14081408
* @param maxDistance {number} maximum distance if set
14091409
*/
1410-
locationsSetup: function (data, lat, lng, firstRun, origin, maxDistance) {
1410+
locationsSetup: function (data, lat, lng, origin, maxDistance) {
14111411
this.writeDebug('locationsSetup',arguments);
14121412
if (typeof origin !== 'undefined') {
14131413
if (!data.distance) {
@@ -1762,7 +1762,7 @@
17621762
this.writeDebug('processData',mappingObject);
17631763
var _this = this;
17641764
var i = 0;
1765-
var orig_lat, orig_lng, origin, name, maxDistance, firstRun, marker, bounds, storeStart, storeNumToShow, myOptions, noResults, distError;
1765+
var orig_lat, orig_lng, origin, name, maxDistance, marker, bounds, storeStart, storeNumToShow, myOptions, noResults, distError;
17661766
if (!this.isEmptyObject(mappingObject)) {
17671767
orig_lat = mappingObject.lat;
17681768
orig_lng = mappingObject.lng;
@@ -1809,7 +1809,7 @@
18091809
}
18101810
}
18111811

1812-
_this.locationsSetup(locationData, orig_lat, orig_lng, firstRun, origin, maxDistance);
1812+
_this.locationsSetup(locationData, orig_lat, orig_lng, origin, maxDistance);
18131813

18141814
i++;
18151815
}
@@ -1824,7 +1824,7 @@
18241824
'description': $(this).find('description').text()
18251825
};
18261826

1827-
_this.locationsSetup(locationData, orig_lat, orig_lng, firstRun, origin, maxDistance);
1827+
_this.locationsSetup(locationData, orig_lat, orig_lng, origin, maxDistance);
18281828

18291829
i++;
18301830
});
@@ -1840,7 +1840,7 @@
18401840
}
18411841
}
18421842

1843-
_this.locationsSetup(locationData, orig_lat, orig_lng, firstRun, origin, maxDistance);
1843+
_this.locationsSetup(locationData, orig_lat, orig_lng, origin, maxDistance);
18441844

18451845
i++;
18461846
});
@@ -1967,7 +1967,7 @@
19671967
}
19681968

19691969
// Avoid error if number of locations is less than the default of 26
1970-
if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit) {
1970+
if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
19711971
storeNum = locationset.length;
19721972
}
19731973
else {
@@ -2121,7 +2121,7 @@
21212121
}
21222122
else {
21232123
// Set up the location list markup
2124-
if (_this.settings.fullMapStartListLimit !== false && ! isNaN(_this.settings.fullMapStartListLimit)) {
2124+
if (firstRun && _this.settings.fullMapStartListLimit !== false && !isNaN(_this.settings.fullMapStartListLimit) && _this.settings.fullMapStartListLimit !== -1) {
21252125
for (var m = 0; m < _this.settings.fullMapStartListLimit; m++) {
21262126
var currentMarker = markers[m];
21272127
_this.listSetup(currentMarker, storeStart, page);

0 commit comments

Comments
 (0)