X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/60123f2c3cb55d31b9ce973a794a0edbe2a282b9..49fd68327eee961b167b0dbbb80e99d6295afe10:/src/wolnelektury/static/js/search.js?ds=inline diff --git a/src/wolnelektury/static/js/search.js b/src/wolnelektury/static/js/search.js index 7f2a69856..536164b50 100644 --- a/src/wolnelektury/static/js/search.js +++ b/src/wolnelektury/static/js/search.js @@ -20,8 +20,8 @@ var __bind = function (self, fn) { }; this.element.autocomplete($.extend(opts, this.options)); - this.element.autocomplete('instance')._renderItem = __bind(this, this.render_item_2022); - this.element.data('autocomplete')._renderItem = __bind(this, this.render_item);; + if (this.element.autocomplete('instance') !== undefined) this.element.autocomplete('instance')._renderItem = __bind(this, this.render_item_2022); + if (this.element.data('autocomplete') !== undefined) this.element.data('autocomplete')._renderItem = __bind(this, this.render_item);; }, enter: function(event, ui) { @@ -46,14 +46,19 @@ var __bind = function (self, fn) { render_item_2022: function (ul, item) { var label; - if (item['author']) { + var $label = $("