bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
493 stars 235 forks source link

default sorts distance by string not as a float #266

Closed bwente closed 1 year ago

bwente commented 4 years ago

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 commented 4 years ago

But now Firefox is reversing the sort order!