Fix issue with double location results
authorMatthias Schmidt <gravatronics@live.com>
Wed, 22 Apr 2015 16:39:34 +0000 (18:39 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 22 Apr 2015 16:39:34 +0000 (18:39 +0200)
wcfsetup/install/files/js/WCF.Location.js

index 4fb601dea0c8bf597bfef7dcf3646a163cf6e259..0c80227a9becbd5e59ddb8eb8975b00248c67128 100644 (file)
@@ -759,8 +759,6 @@ WCF.Location.GoogleMaps.LocationSearch = WCF.Search.Base.extend({
                        this._clearList(true);
                }
                else if ($content.length >= this._triggerLength) {
-                       this._clearList(false);
-                       
                        this._geocoder.geocode({
                                address: $content
                        }, $.proxy(this._success, this));
@@ -778,6 +776,8 @@ WCF.Location.GoogleMaps.LocationSearch = WCF.Search.Base.extend({
         * @param       integer         status
         */
        _success: function(results, status) {
+               this._clearList(false);
+               
                if (status != google.maps.GeocoderStatus.OK) {
                        return;
                }