refactoring
This commit is contained in:
@@ -20,6 +20,10 @@ javascript:
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var suggestion_template = function (data) {
|
||||||
|
return '<p>' + data.plz + ' - ' + data.city + '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
$('#supporter_city').typeahead({
|
$('#supporter_city').typeahead({
|
||||||
minLength: 2,
|
minLength: 2,
|
||||||
},{
|
},{
|
||||||
@@ -27,7 +31,7 @@ javascript:
|
|||||||
display: 'city',
|
display: 'city',
|
||||||
templates: {
|
templates: {
|
||||||
suggestion: function (data) {
|
suggestion: function (data) {
|
||||||
return '<p><strong>' + data.plz + '</strong> - ' + data.city + '</p>';
|
return suggestion_template(data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
source: cities
|
source: cities
|
||||||
@@ -42,7 +46,7 @@ javascript:
|
|||||||
display: 'plz',
|
display: 'plz',
|
||||||
templates: {
|
templates: {
|
||||||
suggestion: function (data) {
|
suggestion: function (data) {
|
||||||
return '<p><strong>' + data.plz + '</strong> - ' + data.city + '</p>';
|
return suggestion_template(data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
source: cities
|
source: cities
|
||||||
|
|||||||
Reference in New Issue
Block a user