allow for editing lat/lng/s/w/n/e via map
This commit is contained in:
parent
1eebdf3805
commit
7eb6f58312
4 changed files with 32 additions and 23 deletions
|
@ -392,10 +392,15 @@ Ox.TextList = function(options, self) {
|
||||||
borderRightWidth: (self.options.columnsVisible ? 1 : 0) + 'px',
|
borderRightWidth: (self.options.columnsVisible ? 1 : 0) + 'px',
|
||||||
textAlign: v.align
|
textAlign: v.align
|
||||||
})
|
})
|
||||||
.html(v.id in data ? formatValue(data[v.id], v.format) : '')
|
.html(v.id in data ? formatValue(v.id, data[v.id]) : '')
|
||||||
.appendTo($item);
|
.appendTo($item);
|
||||||
});
|
});
|
||||||
function formatValue(value, format) {
|
//Math.random() < 0.01 && Ox.print('item', data, $item);
|
||||||
|
return $item;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatValue(key, value) {
|
||||||
|
var format = self.format[key];
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
value = '';
|
value = '';
|
||||||
} else if (format) {
|
} else if (format) {
|
||||||
|
@ -408,9 +413,6 @@ Ox.TextList = function(options, self) {
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
//Math.random() < 0.01 && Ox.print('item', data, $item);
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
function dragstartColumn(id, e) {
|
function dragstartColumn(id, e) {
|
||||||
self.drag = {
|
self.drag = {
|
||||||
|
@ -846,7 +848,8 @@ Ox.TextList = function(options, self) {
|
||||||
return that.$body.value(id, key);
|
return that.$body.value(id, key);
|
||||||
} else {
|
} else {
|
||||||
that.$body.value(id, key, value);
|
that.$body.value(id, key, value);
|
||||||
$cell && $cell.html(column.format ? column.format(value) : value);
|
Ox.print('? ? ?', column, column.format)
|
||||||
|
$cell && $cell.html(formatValue(key, value));
|
||||||
if (key == self.options.sort[0].key) {
|
if (key == self.options.sort[0].key) {
|
||||||
that.$body.sort();
|
that.$body.sort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,14 +283,13 @@ Ox.ListMap = function(options, self) {
|
||||||
that.triggerEvent('addplace', data);
|
that.triggerEvent('addplace', data);
|
||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
changeplace: function(event, data) {
|
changeplace: function(data) {
|
||||||
// fixme: is there a changeplace event in Map???
|
self.$placeForm.values(data).show();
|
||||||
self.$placeForm.values(Ox.map(data, function(val, key) {
|
|
||||||
// fixme: no size key anymore
|
|
||||||
return key == 'size' ? Ox.formatArea(val) : val;
|
|
||||||
})).show();
|
|
||||||
},
|
},
|
||||||
geocode: function(event, data) {
|
changeplaceend: function(data) {
|
||||||
|
editPlace(['lat', 'lng', 'south', 'west', 'north', 'east', 'area']);
|
||||||
|
},
|
||||||
|
geocode: function(data) {
|
||||||
that.triggerEvent('geocode', data);
|
that.triggerEvent('geocode', data);
|
||||||
},
|
},
|
||||||
resize: function() {
|
resize: function() {
|
||||||
|
@ -581,6 +580,12 @@ Ox.ListMap = function(options, self) {
|
||||||
self.options.editPlace(values, function() {
|
self.options.editPlace(values, function() {
|
||||||
if (keys.indexOf(self.$list.options('sort')[0].key) > -1) {
|
if (keys.indexOf(self.$list.options('sort')[0].key) > -1) {
|
||||||
self.$list.reloadList();
|
self.$list.reloadList();
|
||||||
|
} else {
|
||||||
|
Ox.forEach(values, function(value, key) {
|
||||||
|
if (key != 'id') {
|
||||||
|
self.$list.value(values.id, key, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ Ox.MapMarker = function(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function dragend(e) {
|
function dragend(e) {
|
||||||
|
that.map.triggerEvent('changeplaceend', that.place);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMarkerImage(options, callback) {
|
function getMarkerImage(options, callback) {
|
||||||
|
|
|
@ -83,6 +83,7 @@ Ox.MapRectangleMarker = function(options, self) {
|
||||||
that.place.marker.update();
|
that.place.marker.update();
|
||||||
that.place.rectangle.update();
|
that.place.rectangle.update();
|
||||||
}
|
}
|
||||||
|
that.map.triggerEvent('changeplaceend', that.place);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
|
|
Loading…
Reference in a new issue