|
|
@@ -266,18 +266,20 @@ $(document).ready(function() {
|
|
|
results.forEach(function(structure) {
|
|
|
if (((currentPage - 1) * itemsPerPage) <= index && index < (currentPage * itemsPerPage)) {
|
|
|
let cardDiv = $(cardDivModel).clone();
|
|
|
+ let categoryTagModel = cardDiv.find('.structure-category-model').first();
|
|
|
|
|
|
cardDiv.data('id', structure.id);
|
|
|
|
|
|
- let categoryTagModel = cardDiv.find('.structure-category-model').first();
|
|
|
- structure.categories.forEach(function (cat) {
|
|
|
- let tag = categoryTagModel.clone();
|
|
|
- tag.text(structures_categories[cat]);
|
|
|
- tag.removeClass('structure-category-model')
|
|
|
- tag.addClass('structure-category')
|
|
|
- tag.show();
|
|
|
- categoryTagModel.parent().append(tag);
|
|
|
- });
|
|
|
+ if (structure.categories !== null) {
|
|
|
+ structure.categories.forEach(function (cat) {
|
|
|
+ let tag = categoryTagModel.clone();
|
|
|
+ tag.text(structures_categories[cat]);
|
|
|
+ tag.removeClass('structure-category-model')
|
|
|
+ tag.addClass('structure-category')
|
|
|
+ tag.show();
|
|
|
+ categoryTagModel.parent().append(tag);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
cardDiv.find('.structure-poster').first().children('img').first().attr('src', structure.logoUri);
|
|
|
cardDiv.find('.structure-name').first().text(structure.name);
|
|
|
@@ -378,7 +380,7 @@ $(document).ready(function() {
|
|
|
structure.n3Id = parseInt(structure.n3Id);
|
|
|
structure.n4Id = parseInt(structure.n4Id);
|
|
|
structure.n5Id = parseInt(structure.n5Id);
|
|
|
- structure.categories = structure.categories || [];
|
|
|
+ structure.categories = structure.categories !== null ? structure.categories.split(",") : [];
|
|
|
structures.push(structure);
|
|
|
})
|
|
|
|