forked from 0x2620/oxjs
some support for adding/removing places
This commit is contained in:
parent
6229b16a59
commit
ccc4a743d8
4 changed files with 76 additions and 44 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue