Commit a1434a61 authored by Kevin Abel's avatar Kevin Abel
Browse files

Update the logic for rendering the campus designation for markers

parent b6b6f16f
......@@ -70,10 +70,13 @@ class UNL_TourMap_Marker_Building extends UNL_TourMap_Marker
public function getFormattedCampus()
{
if ($this->campus == 'lincoln') {
return 'Lincoln, NE';
} else {
return $this->rawData['location'];
switch ($this->campus) {
case 'city':
case 'east':
case 'innovation':
return ucfirst($this->campus) . ' Campus';
default:
return 'Sites in Lincoln';
}
}
......
......@@ -215,21 +215,22 @@
url: UNL_TOUR_URL+'?view=search&q='+encodeURIComponent(request.term)+'&format=json',
dataType: "json",
success: function(data) {
var rows = [];
var result = 0;
var rows = [], printCampus = '';
for (var code in data['buildings']) {
var printCampus = '';
if (data['buildings'][code].campus == 'lincoln') {
data['buildings'][code].campus = 'Lincoln, NE';
} else {
printCampus = ' Campus';
switch (data['buildings'][code].campus) {
case 'city':
case 'east':
case 'innovation':
printCampus = data['buildings'][code].campus + ' Campus';
break;
default:
printCampus = 'Sites in Lincoln';
}
rows[result] = {
rows.push({
label : data['buildings'][code].name,
value : code,
campus : data['buildings'][code].campus+printCampus
};
result++;
campus : printCampus
});
}
response(rows);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment