Skip to content

Commit cb79fb4

Browse files
committed
Fixed array and object declarations, moved taxonomy filtering and modal setup into init so they're not missed with fullmapstart option
1 parent 7b532c8 commit cb79fb4

File tree

3 files changed

+49
-49
lines changed

3 files changed

+49
-49
lines changed

dist/js/jquery.storelocator.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jQuery Google Maps Store Locator - v1.4.9 - 2014-08-04
1+
/*! jQuery Google Maps Store Locator - v1.4.9 - 2014-08-07
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
33
* Copyright (c) 2014 Bjorn Holine; Licensed MIT */
44

@@ -16,10 +16,8 @@
1616

1717
// Variables used across multiple functions
1818
var $this, listTemplate, infowindowTemplate, dataTypeRead, originalData, originalDataRequest, originalZoom, nameInput, addressInput, olat, olng, storeNum, directionsDisplay, directionsService;
19-
var featuredset, locationset, normalset, markers = [];
20-
var filters = {};
21-
var locationData = {};
22-
var GeoCodeCalc = {};
19+
var featuredset = [], locationset = [], normalset = [], markers = [];
20+
var filters = {}, locationData = {}, GeoCodeCalc = {};
2321

2422
// Create the defaults once. Do not change these settings in this file - settings should be overridden in the plugin call
2523
var defaults = {
@@ -165,6 +163,18 @@
165163
Handlebars.registerHelper('niceURL', function(url) {
166164
return url.replace('https://', '').replace('http://', '');
167165
});
166+
167+
// Do taxonomy filtering if set
168+
if (this.settings.taxonomyFilters !== null) {
169+
this.taxonomyFiltering();
170+
}
171+
172+
// Add modal window divs if set
173+
if (this.settings.modalWindow === true) {
174+
$this.wrap('<div class="' + this.settings.overlayDiv + '"><div class="' + this.settings.modalWindowDiv + '"><div class="' + this.settings.modalContentDiv + '">');
175+
$('.' + this.settings.modalWindowDiv).prepend('<div class="' + this.settings.closeIconDiv + '"></div>');
176+
$('.' + this.settings.overlayDiv).hide();
177+
}
168178

169179
// Load the templates and continue from there
170180
this.loadTemplates();
@@ -242,18 +252,6 @@
242252
* Primary locator function runs after the templates are loaded
243253
*/
244254
locator: function () {
245-
// Do taxonomy filtering if set
246-
if (this.settings.taxonomyFilters !== null) {
247-
this.taxonomyFiltering();
248-
}
249-
250-
// Add modal window divs if set
251-
if (this.settings.modalWindow === true) {
252-
$this.wrap('<div class="' + this.settings.overlayDiv + '"><div class="' + this.settings.modalWindowDiv + '"><div class="' + this.settings.modalContentDiv + '">');
253-
$('.' + this.settings.modalWindowDiv).prepend('<div class="' + this.settings.closeIconDiv + '"></div>');
254-
$('.' + this.settings.overlayDiv).hide();
255-
}
256-
257255
if (this.settings.slideMap === true) {
258256
// Let's hide the map container to begin
259257
$this.hide();
@@ -947,14 +945,16 @@
947945
*/
948946
mapping: function (mappingObj) {
949947
var _this = this;
950-
var firstRun, marker, bounds, storeStart, storeNumToShow, myOptions;
948+
var orig_lat, orig_lng, origin, name, maxDistance, page, firstRun, marker, bounds, storeStart, storeNumToShow, myOptions;
951949
var i = 0;
952-
var orig_lat = mappingObj.lat;
953-
var orig_lng = mappingObj.lng;
954-
var origin = mappingObj.origin;
955-
var name = mappingObj.name;
956-
var maxDistance = mappingObj.distance;
957-
var page = mappingObj.page;
950+
if (!this.isEmptyObject(mappingObj)) {
951+
orig_lat = mappingObj.lat;
952+
orig_lng = mappingObj.lng;
953+
origin = mappingObj.origin;
954+
name = mappingObj.name;
955+
maxDistance = mappingObj.distance;
956+
page = mappingObj.page;
957+
}
958958

959959
// Remove the no results message if it was previously displayed
960960
if($('.bh-sl-noresults').length) {

0 commit comments

Comments
 (0)