Skip to content

Commit b4e229f

Browse files
committed
Consistend dockblock returns, update filtering format for improved exact matches
1 parent f763a68 commit b4e229f

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/js/jquery.storelocator.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
* Check for query string
392392
*
393393
* @param param {string} query string parameter to test
394+
*
394395
* @returns {string} query string value
395396
*/
396397
getQueryString: function(param) {
@@ -790,6 +791,7 @@
790791
*
791792
* @param num {number} the full number
792793
* @param dec {number} the number of digits to show after the decimal
794+
*
793795
* @returns {number}
794796
*/
795797
roundNumber: function (num, dec) {
@@ -801,6 +803,7 @@
801803
* Checks to see if the object is empty. Using this instead of $.isEmptyObject for legacy browser support
802804
*
803805
* @param obj {Object} the object to check
806+
*
804807
* @returns {boolean}
805808
*/
806809
isEmptyObject: function (obj) {
@@ -817,6 +820,7 @@
817820
* Checks to see if all the property values in the object are empty
818821
*
819822
* @param obj {Object} the object to check
823+
*
820824
* @returns {boolean}
821825
*/
822826
hasEmptyObjectVals: function (obj) {
@@ -998,6 +1002,7 @@
9981002
*
9991003
* @param data {array} data array to check for filter values
10001004
* @param filters {Object} taxonomy filters object
1005+
*
10011006
* @returns {boolean}
10021007
*/
10031008
filterData: function (data, filters) {
@@ -1026,6 +1031,7 @@
10261031
*
10271032
* @param currentPage {number}
10281033
* @param totalPages {number}
1034+
*
10291035
* @returns {string}
10301036
*/
10311037
_paginationOutput: function(currentPage, totalPages) {
@@ -1107,6 +1113,7 @@
11071113
* @param markerUrl {string} path to marker image
11081114
* @param markerWidth {number} width of marker
11091115
* @param markerHeight {number} height of marker
1116+
*
11101117
* @returns {Object} Google Maps icon object
11111118
*/
11121119
markerImage: function (markerUrl, markerWidth, markerHeight) {
@@ -1143,6 +1150,7 @@
11431150
* points
11441151
* @param map {Object} the Google Map
11451152
* @param category {string} location category/categories
1153+
*
11461154
* @returns {Object} Google Maps marker
11471155
*/
11481156
createMarker: function (point, name, address, letter, map, category) {
@@ -1223,6 +1231,7 @@
12231231
* @param currentMarker {Object} Google Maps marker
12241232
* @param storeStart {number} optional first location on the current page
12251233
* @param page {number} optional current page
1234+
*
12261235
* @returns {Object} extended location data object
12271236
*/
12281237
_defineLocationData: function (currentMarker, storeStart, page) {
@@ -1525,6 +1534,7 @@
15251534
* Get the address by marker ID
15261535
*
15271536
* @param markerID {number} location ID
1537+
*
15281538
* @returns {string} formatted address
15291539
*/
15301540
getAddressByMarker: function(markerID) {
@@ -2604,24 +2614,24 @@
26042614
return featuredset;
26052615
},
26062616

2607-
/**
2617+
/**
26082618
* Restrict featured locations by distance.
26092619
*
26102620
* @returns {Array}
2611-
*/
2621+
*/
26122622
featuredRestrictions: function(mappingObject) {
2613-
this.writeDebug('featuredRestrictions',arguments);
2623+
this.writeDebug('featuredRestrictions',arguments);
26142624

26152625
if (this.settings.featuredDistance === null) {
26162626
return featuredset;
26172627
}
26182628

26192629
// Featured locations radius restriction.
2620-
if (this.settings.featuredDistance !== null) {
2621-
featuredset = this.featuredDistanceRestriction(mappingObject);
2622-
}
2630+
if (this.settings.featuredDistance !== null) {
2631+
featuredset = this.featuredDistanceRestriction(mappingObject);
2632+
}
26232633

2624-
return featuredset;
2634+
return featuredset;
26252635
},
26262636

26272637
/**
@@ -2814,7 +2824,7 @@
28142824
if (!taxFilters[k]) {
28152825
taxFilters[k] = [];
28162826
}
2817-
taxFilters[k][z] = '(?:^|\\s)' + filters[k][z].replace(/([.*+?^=!:${}()|\[\]\/\\]|&\s+)/g, '');
2827+
taxFilters[k][z] = '(?=.*' + filters[k][z].replace(/([.*+?^=!:${}()|\[\]\/\\]|&\s+)/g, '') + '(?!\\s))';
28182828
}
28192829
}
28202830
}

0 commit comments

Comments
 (0)