Commit 3cfa9867 authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 578572: Make the user autocomplete and keyword autocomplete behave

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
parent 16f1833e
...@@ -684,14 +684,13 @@ YAHOO.bugzilla.userAutocomplete = { ...@@ -684,14 +684,13 @@ YAHOO.bugzilla.userAutocomplete = {
}, },
init_ds : function(){ init_ds : function(){
this.dataSource = new YAHOO.util.XHRDataSource("jsonrpc.cgi"); this.dataSource = new YAHOO.util.XHRDataSource("jsonrpc.cgi");
this.dataSource.connTimeout = 30000;
this.dataSource.connMethodPost = true; this.dataSource.connMethodPost = true;
this.dataSource.connXhrMode = "cancelStaleRequests";
this.dataSource.maxCacheEntries = 5;
this.dataSource.responseSchema = { this.dataSource.responseSchema = {
resultsList : "result.users", resultsList : "result.users",
metaFields : { error: "error", jsonRpcId: "id"}, metaFields : { error: "error", jsonRpcId: "id"},
fields : [
{ key : "email" },
{ key : "real_name"}
]
}; };
}, },
init : function( field, container, multiple ) { init : function( field, container, multiple ) {
...@@ -701,6 +700,7 @@ YAHOO.bugzilla.userAutocomplete = { ...@@ -701,6 +700,7 @@ YAHOO.bugzilla.userAutocomplete = {
var userAutoComp = new YAHOO.widget.AutoComplete( field, container, var userAutoComp = new YAHOO.widget.AutoComplete( field, container,
this.dataSource ); this.dataSource );
// other stuff we might want to do with the autocomplete goes here // other stuff we might want to do with the autocomplete goes here
userAutoComp.maxResultsDisplayed = BUGZILLA.param.maxusermatches;
userAutoComp.generateRequest = this.generateRequest; userAutoComp.generateRequest = this.generateRequest;
userAutoComp.formatResult = this.resultListFormat; userAutoComp.formatResult = this.resultListFormat;
userAutoComp.doBeforeLoadData = this.debug_helper; userAutoComp.doBeforeLoadData = this.debug_helper;
......
...@@ -518,16 +518,19 @@ input.required, select.required, span.required_explanation { ...@@ -518,16 +518,19 @@ input.required, select.required, span.required_explanation {
width:auto !important; } width:auto !important; }
.yui-skin-sam .yui-ac-container { left:0px !important; } .yui-skin-sam .yui-ac-container { left:0px !important; }
.yui-skin-sam .yui-ac { display: inline-block; } .yui-skin-sam .yui-ac { display: inline-block; }
#bugzilla-body .yui-ac-content {
max-height: 19em;
overflow: auto;
overflow-x: hidden;
}
#keyword_container { #keyword_container {
padding-bottom: 2em; padding-bottom: 2em;
padding-top: .2em; padding-top: .2em;
} }
#keyword_container .yui-ac-content { #keyword_container .yui-ac-content {
max-height: 19em;
overflow: auto;
overflow-x: hidden;
margin-left: -1px; margin-left: -1px;
} }
......
...@@ -176,7 +176,8 @@ ...@@ -176,7 +176,8 @@
#%] #%]
var BUGZILLA = { var BUGZILLA = {
param: { param: {
cookiepath: '[% Param('cookiepath') FILTER js %]' cookiepath: '[% Param('cookiepath') FILTER js %]',
maxusermatches: [% Param('maxusermatches') FILTER js %]
}, },
string: { string: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment