]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 578572: Make the user autocomplete and keyword autocomplete behave
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 2 Aug 2010 00:53:34 +0000 (17:53 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 2 Aug 2010 00:53:34 +0000 (17:53 -0700)
similarly, and fix a race condition in user autocomplete where sometimes
an older result would appear after a newer result, overriding the newer
result.
r=pyrzak, a=mkanat

js/field.js
skins/standard/global.css
template/en/default/global/header.html.tmpl

index 2fff5931dff9cf3d8688873c220f3ea72e71dfae..4734dc9be18e71b167d3b0a875410a02db0642ff 100644 (file)
@@ -678,14 +678,13 @@ YAHOO.bugzilla.userAutocomplete = {
     },    
     init_ds : function(){
         this.dataSource = new YAHOO.util.XHRDataSource("jsonrpc.cgi");
+        this.dataSource.connTimeout = 30000;
         this.dataSource.connMethodPost = true;
+        this.dataSource.connXhrMode = "cancelStaleRequests";
+        this.dataSource.maxCacheEntries = 5;
         this.dataSource.responseSchema = {
             resultsList : "result.users",
             metaFields : { error: "error", jsonRpcId: "id"},
-            fields : [
-                { key : "email" },
-                { key : "real_name"}
-            ]
         };    
     },
     init : function( field, container, multiple ) {
@@ -695,6 +694,7 @@ YAHOO.bugzilla.userAutocomplete = {
         var userAutoComp = new YAHOO.widget.AutoComplete( field, container, 
                                 this.dataSource );
         // other stuff we might want to do with the autocomplete goes here
+        userAutoComp.maxResultsDisplayed = BUGZILLA.param.maxusermatches;
         userAutoComp.generateRequest = this.generateRequest;
         userAutoComp.formatResult = this.resultListFormat;
         userAutoComp.doBeforeLoadData = this.debug_helper;
index c5dd62156fdea3195b2fb1fb411b900099c10eeb..4f2709e109ccd2a4ecc7b4386c316754421e53cd 100644 (file)
@@ -518,16 +518,19 @@ input.required, select.required, span.required_explanation {
                               width:auto !important; }
 .yui-skin-sam .yui-ac-container { left:0px !important; }
 .yui-skin-sam .yui-ac { display: inline-block; }
+#bugzilla-body .yui-ac-content {
+    max-height: 19em;
+    overflow: auto;
+    overflow-x: hidden;
+}
 
 #keyword_container {
     padding-bottom: 2em;
     padding-top: .2em;
 }
 
+
 #keyword_container .yui-ac-content {
-    max-height: 19em;
-    overflow: auto;
-    overflow-x: hidden;
     margin-left: -1px;
 }
 
index a3509479395213154c76fe129bcd09fd3bdfa97c..799f4898f49e5f3c17d147b4395d6f698fa11af2 100644 (file)
           #%]
         var BUGZILLA = {
             param: {
-                cookiepath: '[% Param('cookiepath') FILTER js %]'
+                cookiepath: '[% Param('cookiepath') FILTER js %]',
+                maxusermatches: [% Param('maxusermatches') FILTER js %]
             },
 
             string: {