1
0
Fork 0
forked from 0x2620/oxjs

some support for adding/removing places

This commit is contained in:
rolux 2011-05-29 17:09:42 +02:00
commit ccc4a743d8
4 changed files with 76 additions and 44 deletions

View file

@ -1,5 +1,7 @@
Ox.load('UI', {
debug: true,
hideScreen: true,
showScreen: true,
theme: 'modern'
}, function() {
@ -135,9 +137,19 @@ Ox.load('Geo', function() {
width: window.innerWidth
})
.bindEvent({
addplace: function(data) {
Ox.print('addplace', data);
places.push(Ox.extend(data.place, {
geonameSort: getGeonameSort(data.place.geoname)
}));
},
geocode: function(event, data) {
Ox.print(event)
Ox.print(JSON.stringify(data))
},
removeplace: function(data) {
var i = Ox.getPositionById(places, data.id);
places.splice(i, 1);
}
})
.appendTo(Ox.UI.$body);