From 0d09bf62afedfb9ba78343ecab64715a79ac4669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 6 Jan 2017 17:26:35 +0100 Subject: [PATCH] Completion starts only when we have 3 characters And this time it works --- gestioncof/autocomplete_light_registry.py | 4 ++-- gestioncof/templates/registration.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gestioncof/autocomplete_light_registry.py b/gestioncof/autocomplete_light_registry.py index 2573df10..4c62d995 100644 --- a/gestioncof/autocomplete_light_registry.py +++ b/gestioncof/autocomplete_light_registry.py @@ -6,5 +6,5 @@ from django.contrib.auth.models import User autocomplete_light.register( User, search_fields=('username', 'first_name', 'last_name'), - autocomplete_js_attributes={'placeholder': 'membre...'}, - widget_attrs={'data-widget-minimum-values': 3}) + attrs={'placeholder': 'membre...'} +) diff --git a/gestioncof/templates/registration.html b/gestioncof/templates/registration.html index 4f15a4b7..c7f322e6 100644 --- a/gestioncof/templates/registration.html +++ b/gestioncof/templates/registration.html @@ -18,7 +18,7 @@ $(document).ready(function() { $('input#search_autocomplete').yourlabsAutocomplete({ url: '{% url 'gestioncof.autocomplete.autocomplete' %}', - minimumCharacters: 1, + minimumCharacters: 3, id: 'search_autocomplete', choiceSelector: 'li:has(a)', placeholder: "Chercher un utilisateur par nom, prénom ou identifiant clipper",