jQuery-Store-Locator-Plugin icon indicating copy to clipboard operation
jQuery-Store-Locator-Plugin copied to clipboard

default sorts distance by string not as a float

Open bwente opened this issue 4 years ago • 1 comments

I thought it was my JSON the whole time, but it was the javascript.

			if (this.settings.sortBy !== null && this.settings.sortBy.hasOwnProperty('order') && this.settings.sortBy.order.toString() === 'desc') {
				locationsarray.sort(function (a, b) {
					//return ((b[property] < a[property]) ? -1 : ((b[property] > a[property]) ? 1 : 0));
					return (a-b);
				});

bwente avatar Sep 17 '20 03:09 bwente

But now Firefox is reversing the sort order!

bwente avatar Sep 17 '20 04:09 bwente