X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/aed70facf3a26e27b1a96b04cad8139de600e42f..9bc86f5a6542c5893ac94284da33162a7c7be2d6:/src/wolnelektury/static/js/search.js?ds=sidebyside diff --git a/src/wolnelektury/static/js/search.js b/src/wolnelektury/static/js/search.js index e3e50b780..536164b50 100644 --- a/src/wolnelektury/static/js/search.js +++ b/src/wolnelektury/static/js/search.js @@ -46,14 +46,19 @@ var __bind = function (self, fn) { render_item_2022: function (ul, item) { var label; - if (item['author']) { + var $label = $("
  • "); + if (item.img) { + $('div', $label).append($('').attr('src', item.img)); + } + if (item.author) { label = '' + item.label + ', ' + item['author']; } else { label = item.label; } - return $("
  • ") - .append(''+label+'') - .appendTo(ul); + $('span', $label).html(label); + $label.addClass('type-' + item.type); + $label.appendTo(ul); + return $label; }, destroy: function() {