1
0
Fork 0
forked from 0x2620/oxjs

in manage places, make south/west/north/east editable directly (fixes #411)

This commit is contained in:
rlx 2012-02-21 09:37:50 +00:00
commit 8851a9c454
3 changed files with 15 additions and 50 deletions

View file

@ -509,6 +509,7 @@ Ox.ListMap = function(options, self) {
).toLowerCase(),
max = ['Latitude', 'South', 'North'].indexOf(v) > -1 ? Ox.MAX_LATITUDE : 180;
return Ox.Input({
changeOnKeypress: true,
decimals: 8,
disabled: ['lat', 'lng'].indexOf(id) > -1,
id: id,
@ -532,6 +533,7 @@ Ox.ListMap = function(options, self) {
.hide()
.bindEvent({
change: function(data) {
Ox.print('CHANGE', data)
var isResult = self.selectedPlace[0] == '_';
if (data.id == 'name') {
!isResult && self.$list.value(self.selectedPlace, 'name', data.data.value);
@ -573,14 +575,14 @@ Ox.ListMap = function(options, self) {
if (!self.isAsync) {
// ...
} else {
!isResult && editPlace(['type'])
!isResult && editPlace(['type']);
}
self.$map.value(self.selectedPlace, 'type', data.data.value);
} else { // lat, lng, south, west, north, east
} else { // south, west, north, east
if (!self.isAsync) {
// ...
} else {
!isResult && editPlace([data.id])
!isResult && editPlace([data.id]);
}
self.$map.value(self.selectedPlace, data.id, parseFloat(data.data.value));
}