Simplify, can't use the onShow callback in this way anymore, remove commented out...
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 7 Nov 2009 21:21:13 +0000 (16:21 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 7 Nov 2009 21:21:13 +0000 (16:21 -0500)
ansel/js/googlemap_edit.js
ansel/lib/Ajax/Imple/LocationAutoCompleter.php

index 757e4a8..7bad48e 100644 (file)
@@ -82,7 +82,7 @@ Ansel_MapEdit.prototype = {
             lng: this._map.points[0].getLatLng().lng(),
             type: 'geotag'
         };
-        //url = this._options.url;
+
         new Ajax.Request(o.xurl, {
             method: 'post',
             parameters: params,
@@ -111,6 +111,7 @@ Ansel_MapEdit.prototype = {
             this._map.getLocations(this._map.points[0]);
             this._map.mainMap.setCenter(gll, this._map.defaultZoom);
             $(o.statusId).update('');
+            this.ll = null;
         } else {
             this._map.geocoder.getLocations($(o.locationInput).value, function(address) {
                 if (address.Status.code == '200') {
index fea823d..e791978 100644 (file)
@@ -20,8 +20,7 @@ class Ansel_Ajax_Imple_LocationAutoCompleter extends Horde_Ajax_Imple_AutoComple
         $ret = array(
             'params' => $js_params,
             'raw_params' => array(
-                'onSelect' => 'function (v) { ' . $this->_params['map'] . '.ll = Ansel.ajax.locationAutoCompleter.geocache[v];return v;}',
-                'onShow' => 'function (e) { if (!e.size()) ' . $this->_params['map'] . '.ll = null; }'
+                'onSelect' => 'function (v) { ' . $this->_params['map'] . '.ll = Ansel.ajax.locationAutoCompleter.geocache[v]; return v; }'
             ),
             'var' => "Ansel.ajax['locationAutoCompleter']"
         );