changeset 326:5453aedf95fd

Adjusting the auto-complete to only require 1 character minimum before querying, and return 15 results instead of 10.
author Brian Neal <bgneal@gmail.com>
date Sun, 20 Feb 2011 22:12:06 +0000
parents d8b634e67043
children a1bf6cf49720
files gpp/core/widgets.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/core/widgets.py	Sun Feb 20 22:09:56 2011 +0000
+++ b/gpp/core/widgets.py	Sun Feb 20 22:12:06 2011 +0000
@@ -20,7 +20,7 @@
     var cacheSize = 0;
     $("#id_%s").autocomplete({
         delay: 400,
-        minLength: 2,
+        minLength: 1,
         source: function(request, response) {
             if (cache[request.term]) {
                response(cache[request.term]);
@@ -31,11 +31,11 @@
                 type: "GET",
                 data: {
                     q: request.term,
-                    limit: 10
+                    limit: 15
                 },
                 dataType: "json",
                 success: function(data, textStatus) {
-                    if (cacheSize >= 16) {
+                    if (cacheSize >= 32) {
                        cache = {};
                        cacheSize = 0;
                     }