1010// collection of javascript arrays containing strings.
1111
1212/**
13- * Reads the selected products and updates component, version and milestone
14- * lists accordingly.
13+ * Reads the selected products and updates the component list accordingly.
1514 *
1615 * @param product Select element that contains products.
17- * @param component Select element that contains components. Can be null if
18- * there is no such element to update.
19- * @param version Select element that contains versions. Can be null if
20- * there is no such element to update.
21- * @param milestone Select element that contains milestones. Can be null if
22- * there is no such element to update.
16+ * @param component Select element that contains components.
2317 * @param anyval Value to use for a special "Any" list item. Can be null
2418 * to not use any. If used must and will be first item in
2519 * the select element.
2620 *
2721 * @global cpts Array of arrays, indexed by product name. The subarrays
2822 * contain a list of components to be fed to the respective
2923 * select element.
30- * @global vers Array of arrays, indexed by product name. The subarrays
31- * contain a list of versions to be fed to the respective
32- * select element.
33- * @global tms Array of arrays, indexed by product name. The subarrays
34- * contain a list of milestones to be fed to the respective
35- * select element.
3624 * @global first_load Boolean; true if this is the first time this page loads
3725 * or false if not.
3826 * @global last_sel Array that contains last list of products so we know what
3927 * has changed, and optimize for additions.
4028 */
41- function selectProduct ( product , component , version , milestone , anyval ) {
29+ function selectProduct ( product , component , anyval ) {
4230 // This is to avoid handling events that occur before the form
4331 // itself is ready, which could happen in buggy browsers.
44- if ( ! product )
32+ if ( ! product || ! component )
4533 return ;
4634
4735 // Do nothing if no products are defined. This is to avoid the
@@ -78,15 +66,8 @@ function selectProduct(product, component, version, milestone, anyval) {
7866 var findall = ( product . selectedIndex == - 1
7967 || ( anyval != null && product . options [ 0 ] . selected ) ) ;
8068
81- if ( useclassification ) {
82- // Update index based on the complete product array.
83- sel = get_selection ( product , findall , true , anyval ) ;
84- for ( var i = 0 ; i < sel . length ; i ++ )
85- sel [ i ] = prods [ sel [ i ] ] ;
86- }
87- else {
88- sel = get_selection ( product , findall , false , anyval ) ;
89- }
69+ sel = get_selection ( product , findall , false , anyval ) ;
70+
9071 if ( ! findall ) {
9172 // Save sel for the next invocation of selectProduct().
9273 var tmp = sel ;
@@ -103,23 +84,9 @@ function selectProduct(product, component, version, milestone, anyval) {
10384 }
10485
10586 // Do the actual fill/update.
106- if ( component ) {
107- var saved_cpts = get_selection ( component , false , true , null ) ;
108- updateSelect ( cpts , sel , component , merging , anyval ) ;
109- restoreSelection ( component , saved_cpts ) ;
110- }
111-
112- if ( version ) {
113- var saved_vers = get_selection ( version , false , true , null ) ;
114- updateSelect ( vers , sel , version , merging , anyval ) ;
115- restoreSelection ( version , saved_vers ) ;
116- }
117-
118- if ( milestone ) {
119- var saved_tms = get_selection ( milestone , false , true , null ) ;
120- updateSelect ( tms , sel , milestone , merging , anyval ) ;
121- restoreSelection ( milestone , saved_tms ) ;
122- }
87+ var saved_cpts = get_selection ( component , false , true , null ) ;
88+ updateSelect ( cpts , sel , component , merging , anyval ) ;
89+ restoreSelection ( component , saved_cpts ) ;
12390}
12491
12592/**
0 commit comments