mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
commit
de6d52cfb1
@ -13,7 +13,9 @@ $('.filter-country-btn').on('click', function () {
|
|||||||
countries = callback;
|
countries = callback;
|
||||||
resetValue('country', true, false)
|
resetValue('country', true, false)
|
||||||
$.each(countries, function (index, value) {
|
$.each(countries, function (index, value) {
|
||||||
$('.filter-location-modal .countries').append(item('country', value.id, value.name, value.abv.toLowerCase()));
|
$('.filter-location-modal .countries').append(
|
||||||
|
item('country', value.id, value.name, value.abv ? value.abv.toLowerCase() : '')
|
||||||
|
);
|
||||||
});
|
});
|
||||||
if (countries == "")
|
if (countries == "")
|
||||||
$('.filter-location-modal .countries').html(null_msg);
|
$('.filter-location-modal .countries').html(null_msg);
|
||||||
@ -245,22 +247,24 @@ function locationCrud(params, url, type, beforeSend, callback) {
|
|||||||
function item(field_name, id, value, abv = '') {
|
function item(field_name, id, value, abv = '') {
|
||||||
var selected = defaultCountry === id ? "checked" : "";
|
var selected = defaultCountry === id ? "checked" : "";
|
||||||
if (field_name === 'country') {
|
if (field_name === 'country') {
|
||||||
return '<li class="px-2" data-id="' + id + '">\n' +
|
return `
|
||||||
' <label class="w-100">\n' +
|
<li class="px-2" data-id="${id}">
|
||||||
' <input' +
|
<label class="w-100">
|
||||||
' type="checkbox" data-field="' + field_name + '" data-id="' + id + '" '+ selected +'>\n' +
|
<input type="checkbox" data-field="${field_name}" data-id="${id}" ${selected}>
|
||||||
' <span class="flag ml-1 flag-' + abv + '">\n' +
|
<span class="flag ml-1 flag-${abv}"></span>
|
||||||
' </span>\n' +
|
<small>${value}</small>
|
||||||
' <small>' + value + '</small>\n' +
|
</label>
|
||||||
' </label>\n' +
|
</li>
|
||||||
' </li>';
|
`;
|
||||||
} else {
|
} else {
|
||||||
return '<li class="px-2" data-id="' + id + '">\n' +
|
return `
|
||||||
' <label class="w-100">\n' +
|
<li class="px-2" data-id="${id}">
|
||||||
' <input type="checkbox" data-field="' + field_name + '" data-id="' + id + '">\n' +
|
<label class="w-100">
|
||||||
' <small>' + value + '</small>\n' +
|
<input type="checkbox" data-field="${field_name}" data-id="${id}">
|
||||||
' </label>\n' +
|
<small>${value}</small>
|
||||||
' </li>';
|
</label>
|
||||||
|
</li>
|
||||||
|
`;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user