diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2012-05-07 17:58:22 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-05-07 17:58:22 +0200 |
commit | 92a81752931c5fd7cdbf4b63305389844193d029 (patch) | |
tree | 13cae837e5d0491e9ad5d6426b558de741d261eb /js | |
parent | 4e5dcf363dd1ffa63f0d7a190fa61891061ddea2 (diff) | |
download | bugzilla-92a81752931c5fd7cdbf4b63305389844193d029.tar.gz bugzilla-92a81752931c5fd7cdbf4b63305389844193d029.tar.xz |
Bug 616191: Implement UI to easily tag bugs from the bug report directly (and get rid of the current form in the footer)
r=timello a=LpSolit
Diffstat (limited to 'js')
-rw-r--r-- | js/field.js | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/js/field.js b/js/field.js index 9583db02c..1e5595081 100644 --- a/js/field.js +++ b/js/field.js @@ -870,27 +870,29 @@ YAHOO.bugzilla.userAutocomplete = { } }; -YAHOO.bugzilla.keywordAutocomplete = { - dataSource : null, - init_ds : function(){ - this.dataSource = new YAHOO.util.LocalDataSource( YAHOO.bugzilla.keyword_array ); +YAHOO.bugzilla.fieldAutocomplete = { + dataSource : [], + init_ds : function( field ) { + this.dataSource[field] = + new YAHOO.util.LocalDataSource( YAHOO.bugzilla.field_array[field] ); }, init : function( field, container ) { - if( this.dataSource == null ){ - this.init_ds(); + if( this.dataSource[field] == null ) { + this.init_ds( field ); } - 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 + var fieldAutoComp = + new YAHOO.widget.AutoComplete(field, container, this.dataSource[field]); + fieldAutoComp.maxResultsDisplayed = YAHOO.bugzilla.field_array[field].length; + fieldAutoComp.minQueryLength = 0; + fieldAutoComp.useIFrame = true; + fieldAutoComp.delimChar = [","," "]; + fieldAutoComp.resultTypeList = false; + fieldAutoComp.queryDelay = 0; + /* Causes all the possibilities in the field to appear when a user * focuses on the textbox */ - keywordAutoComp.textboxFocusEvent.subscribe( function(){ - var sInputValue = YAHOO.util.Dom.get('keywords').value; + fieldAutoComp.textboxFocusEvent.subscribe( function(){ + var sInputValue = YAHOO.util.Dom.get(field).value; if( sInputValue.length === 0 ){ this.sendQuery(sInputValue); this.collapseContainer(); |