only link to locations that can be searched
This commit is contained in:
parent
06b7ef84a2
commit
cd27a6a099
5 changed files with 39 additions and 15 deletions
|
@ -218,6 +218,9 @@ section.details {
|
|||
margin: 0 0 0.7rem;
|
||||
padding: 0 0 0 1rem;
|
||||
}
|
||||
#location-details dd > * {
|
||||
display:block;
|
||||
}
|
||||
|
||||
main:not([data-view$=search]) #autocomplete,
|
||||
main:not([data-view=location]) #location-details,
|
||||
|
|
|
@ -146,11 +146,15 @@ c3nav = {
|
|||
console.log(sublocations);
|
||||
for (var j = 0; j < sublocations.length; j++) {
|
||||
loc = sublocations[j];
|
||||
loclist.append($('<a>').attr('href', '/l/' + loc.slug + '/details/').attr('data-id', loc.id).click(function (e) {
|
||||
e.preventDefault();
|
||||
c3nav._locationinput_set($('#destination-input'), c3nav.locations_by_id[parseInt($(this).attr('data-id'))]);
|
||||
c3nav.update_state(false, false, true);
|
||||
}).text(loc.title));
|
||||
if (loc.can_searc) {
|
||||
loclist.append($('<a>').attr('href', '/l/' + loc.slug + '/details/').attr('data-id', loc.id).click(function (e) {
|
||||
e.preventDefault();
|
||||
c3nav._locationinput_set($('#destination-input'), c3nav.locations_by_id[parseInt($(this).attr('data-id'))]);
|
||||
c3nav.update_state(false, false, true);
|
||||
}).text(loc.title));
|
||||
} else {
|
||||
loclist.append($('<span>').text(loc.title));
|
||||
}
|
||||
}
|
||||
elem.append(loclist);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue