From 120a28eaa2c754d8b0499d9f35687dabdc0aac02 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 30 May 2011 11:09:52 +0200 Subject: [PATCH] use correct api for add/edit/remove place; fix demo --- demos/listmap2/js/listmap.js | 6 +++--- source/Ox.UI/js/Map/Ox.ListMap.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/listmap2/js/listmap.js b/demos/listmap2/js/listmap.js index eb919c97..ce35fb09 100644 --- a/demos/listmap2/js/listmap.js +++ b/demos/listmap2/js/listmap.js @@ -48,9 +48,9 @@ Ox.load('Geo', function() { var $listmap = new Ox.ListMap({ addPlace: function(data, callback) { var id = Ox.encodeBase32(Ox.uid()); - Ox.print('addplace', getGeonameSort(data.place.geoname)); - places.push(Ox.extend(data.place, { - geonameSort: getGeonameSort(data.place.geoname), + Ox.print('addplace', getGeonameSort(data.geoname)); + places.push(Ox.extend(data, { + geonameSort: getGeonameSort(data.geoname), id: id })); callback({ diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 23c64cf2..87b891b7 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -572,7 +572,7 @@ Ox.ListMap = function(options, self) { } //that.triggerEvent('addplace', {place: place}); if (self.isAsync) { - self.options.addPlace({place: place}, function(result) { + self.options.addPlace(place, function(result) { place.id = result.data.id; self.selectedPlace = place.id; self.$list.reloadList().options({selected: [place.id]});