summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/field.js34
1 files changed, 32 insertions, 2 deletions
diff --git a/js/field.js b/js/field.js
index 39b272f92..20485bcc8 100644
--- a/js/field.js
+++ b/js/field.js
@@ -16,6 +16,7 @@
*
* Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org>
* Guy Pyrzak <guy.pyrzak@gmail.com>
+ * Reed Loden <reed@reedloden.com>
*/
/* This library assumes that the needed YUI libraries have been loaded
@@ -621,8 +622,8 @@ YAHOO.bugzilla.userAutocomplete = {
userAutoComp.autoHighlight = false;
// this is a throttle to determine the delay of the query from typing
// set this higher to cause fewer calls to the server
- userAutoComp.queryDelay = 0.05
- userAutoComp.useIFrame = true
+ userAutoComp.queryDelay = 0.05;
+ userAutoComp.useIFrame = true;
userAutoComp.resultTypeList = false;
if( multiple == true ){
userAutoComp.delimChar = [","," "];
@@ -631,3 +632,32 @@ YAHOO.bugzilla.userAutocomplete = {
}
};
+YAHOO.bugzilla.keywordAutocomplete = {
+ dataSource : null,
+ init_ds : function(){
+ this.dataSource = new YAHOO.util.LocalDataSource( YAHOO.bugzilla.keyword_array );
+ },
+ init : function( field, container ) {
+ if( this.dataSource == null ){
+ this.init_ds();
+ }
+ var keywordAutoComp = new YAHOO.widget.AutoComplete(field, container, this.dataSource);
+ keywordAutoComp.maxResultsDisplayed = YAHOO.bugzilla.keyword_array.length;
+ keywordAutoComp.minQueryLength = 0;
+ keywordAutoComp.useIFrame = true;
+ keywordAutoComp.delimChar = [","," "];
+ keywordAutoComp.resultTypeList = false;
+ keywordAutoComp.queryDelay = 0;
+ /* Causes all the possibilities in the keyword to appear when a user
+ * focuses on the textbox
+ */
+ keywordAutoComp.textboxFocusEvent.subscribe( function(){
+ var sInputValue = YAHOO.util.Dom.get('keywords').value;
+ if( sInputValue.length === 0 ){
+ this.sendQuery(sInputValue);
+ this.collapseContainer();
+ this.expandContainer();
+ }
+ });
+ }
+};