X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/360d9d37f72b1c6e2edb83c3a0218e55578134f3..dd79289baf8168c654faaaa5c8e5840e3a63f94e:/src/redakcja/static/js/wiki/view_properties.js diff --git a/src/redakcja/static/js/wiki/view_properties.js b/src/redakcja/static/js/wiki/view_properties.js index 1fff64fe..fd53f041 100644 --- a/src/redakcja/static/js/wiki/view_properties.js +++ b/src/redakcja/static/js/wiki/view_properties.js @@ -267,7 +267,15 @@ } else { $aninput = $(""); if (field.value_type.autocomplete) { - $aninput.autocomplete(field.value_type.autocomplete); + let autoOptions = field.value_type.autocomplete; + $aninput.autocomplete(autoOptions).autocomplete('instance')._renderItem = function(ul, item) { + let t = item.label; + if (item.name) t += '
' + item.name + ''; + if (item.description) t += '
' + item.description + ''; + return $( "
  • " ) + .append( "
    " + t + "
    " ) + .appendTo( ul ); + }; } } $aninput.data('edited', $(element))