forked from 0x2620/oxjs
update manage places / manage events
This commit is contained in:
parent
a9089ee8f7
commit
e4b60c83c2
8 changed files with 676 additions and 482 deletions
|
|
@ -536,6 +536,7 @@ Ox.Map = function(options, self) {
|
|||
self.options.selected = place.id;
|
||||
place.countryCode = country ? country.code : '';
|
||||
Ox.Log('Map', 'addP2P', data, place);
|
||||
setPlaceControls(place);
|
||||
place.marker.update();
|
||||
self.places.push(place);
|
||||
self.resultPlace = null;
|
||||
|
|
@ -1204,7 +1205,9 @@ Ox.Map = function(options, self) {
|
|||
src: Ox.getFlagByGeoname(place.geoname, 16)
|
||||
})
|
||||
).show();
|
||||
self.$placeControls.name.options({title: place.name})
|
||||
self.$placeControls.name.options({
|
||||
title: place.name ||'<span class="OxLight">Unnamed</span>'
|
||||
});
|
||||
!isVisible && $placeControls.show().animate({opacity: 1}, 250);
|
||||
} else {
|
||||
isVisible && $placeControls.animate({opacity: 0}, 250, function() {
|
||||
|
|
@ -1272,7 +1275,7 @@ Ox.Map = function(options, self) {
|
|||
function submitFind(data) {
|
||||
self.options.find = data.value;
|
||||
if (data.value === '') {
|
||||
if (self.options.selected[0] == '_') {
|
||||
if (self.options.selected && self.options.selected[0] == '_') {
|
||||
selectPlace(null);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1542,6 +1545,17 @@ Ox.Map = function(options, self) {
|
|||
that.value = function(id, key, value) {
|
||||
// fixme: should be like the corresponding List/TextList/etc value function
|
||||
Ox.print('Map', 'Map.value', id, key, value)
|
||||
if (id == self.options.selected) {
|
||||
if (key == 'name') {
|
||||
self.$placeControls.name.options({title: value});
|
||||
} else if (key == 'geoname') {
|
||||
self.$placeControls.flag.empty().append(
|
||||
$('<img>').attr({
|
||||
src: Ox.getFlagByGeoname(value, 16)
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
getPlaceById(id).options(key, value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue