X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ec93d5082ab137ec690f310eb6eba3c54d10b825..55bc643c16dc56cf2377bd5c4d6e924d5fc62698:/apps/catalogue/fields.py?ds=inline diff --git a/apps/catalogue/fields.py b/apps/catalogue/fields.py index 853a321ca..e19df9d37 100644 --- a/apps/catalogue/fields.py +++ b/apps/catalogue/fields.py @@ -104,15 +104,8 @@ class JQueryAutoCompleteSearchWidget(JQueryAutoCompleteWidget): super(JQueryAutoCompleteSearchWidget, self).__init__(*args, **kwargs) def render_js(self, field_id, options): - return u""" - $('#%s') - .autocomplete($.extend({ - minLength: 0, - select: autocomplete_result_handler - }, %s)) - .data("autocomplete")._renderItem = autocomplete_format_item; - """ % (field_id, options) - + return u"" + class JQueryAutoCompleteField(forms.CharField): def __init__(self, source, options={}, *args, **kwargs): @@ -124,9 +117,8 @@ class JQueryAutoCompleteField(forms.CharField): class JQueryAutoCompleteSearchField(forms.CharField): - def __init__(self, source, options={}, *args, **kwargs): + def __init__(self, options={}, *args, **kwargs): if 'widget' not in kwargs: - options['source'] = source kwargs['widget'] = JQueryAutoCompleteSearchWidget(options) super(JQueryAutoCompleteSearchField, self).__init__(*args, **kwargs)