add location icon to autocomplete

This commit is contained in:
Laura Klünder 2017-11-15 14:45:04 +01:00
parent 66a90ed3d9
commit 79a9f95b02
2 changed files with 5 additions and 2 deletions

View file

@ -110,7 +110,8 @@ main:not([data-view=route-result]) #route-result-buttons{
}
.location {
padding: 5px 10px;
position: relative;
padding: 5px 10px 5px 53px;
height: 55px;
}
.location .icon {

View file

@ -212,7 +212,9 @@ c3nav = {
$.getJSON('/api/locations/?searchable', function (data) {
for (var i = 0; i < data.length; i++) {
var location = data[i];
location.elem = $('<div class="location">').append($('<span>').text(location.title))
location.elem = $('<div class="location">')
.append($('<i class="icon material-icons">').text('place'))
.append($('<span>').text(location.title))
.append($('<small>').text(location.subtitle)).attr('data-id', location.id)[0].outerHTML;
location.title_words = location.title.toLowerCase().split(/\s+/);
location.match = ' ' + location.title_words.join(' ') + ' ';