forked from 0x2620/oxjs
improve listmap editing functionality
This commit is contained in:
parent
02442a24f7
commit
b17e8a783b
6 changed files with 48 additions and 35 deletions
|
|
@ -110,33 +110,6 @@ Ox.ListMap = function(options, self) {
|
|||
visible: true,
|
||||
width: 192
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
format: {type: 'area', args: [0]},
|
||||
id: 'area',
|
||||
operator: '-',
|
||||
title: 'Area',
|
||||
visible: true,
|
||||
width: 128
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
format: toFixed,
|
||||
id: 'lat',
|
||||
operator: '+',
|
||||
title: 'Latitude',
|
||||
visible: true,
|
||||
width: 96
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
format: toFixed,
|
||||
id: 'lng',
|
||||
operator: '+',
|
||||
title: 'Longitude',
|
||||
visible: true,
|
||||
width: 96
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
format: toFixed,
|
||||
|
|
@ -172,6 +145,33 @@ Ox.ListMap = function(options, self) {
|
|||
visible: false,
|
||||
width: 96
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
format: toFixed,
|
||||
id: 'lat',
|
||||
operator: '+',
|
||||
title: 'Latitude',
|
||||
visible: true,
|
||||
width: 96
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
format: toFixed,
|
||||
id: 'lng',
|
||||
operator: '+',
|
||||
title: 'Longitude',
|
||||
visible: true,
|
||||
width: 96
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
format: {type: 'area', args: [0]},
|
||||
id: 'area',
|
||||
operator: '-',
|
||||
title: 'Area',
|
||||
visible: true,
|
||||
width: 128
|
||||
},
|
||||
{
|
||||
id: 'user',
|
||||
operator: '+',
|
||||
|
|
@ -347,6 +347,7 @@ Ox.ListMap = function(options, self) {
|
|||
label: 'Area',
|
||||
labelWidth: 80,
|
||||
textAlign: 'right',
|
||||
type: 'float',
|
||||
width: 240
|
||||
})
|
||||
]);
|
||||
|
|
@ -374,10 +375,13 @@ Ox.ListMap = function(options, self) {
|
|||
self.$map.newPlace();
|
||||
self.$placeButton.options({title: 'Add Place'})
|
||||
} else if (title == 'Add Place') {
|
||||
var place = self.$placeForm.values();
|
||||
var place = self.$placeForm.values(),
|
||||
country = Ox.getCountryByGeoname(place.geoname);
|
||||
place.countryCode = country ? country.code : '';
|
||||
place.id = self.selectedPlace.substr(1); // fixme: safe?
|
||||
self.options.places.push(place);
|
||||
self.$map.addPlace(place);
|
||||
//self.$placeButton.options({title: 'Please Wait...'})
|
||||
self.$list.options({items: Ox.clone(self.options.places)});
|
||||
self.$list.options({selected: [place.id]});
|
||||
//self.$list.addItem(place);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue