Commit 0cd4b869 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 258647: productmenu.js and productform.js should be consolidated - Patch by…

Bug 258647: productmenu.js and productform.js should be consolidated - Patch by Teemu Mannermaa <wicked+bz@etlicon.fi> r=myk a=LpSolit
parent fcdf86c3
......@@ -46,8 +46,8 @@
table#form th { text-align: right; vertical-align: baseline; white-space: nowrap; }
table#form td { text-align: left; vertical-align: baseline; }
"
onload="selectProduct(document.forms[0], 'product', 'component', '__Any__');"
javascript_urls=["productmenu.js"]
onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, '__Any__');"
javascript_urls=["js/productform.js"]
%]
<form method="post" action="editflagtypes.cgi">
......@@ -100,7 +100,7 @@
<tr>
<td style="vertical-align: top;">
<b>Product/Component:</b><br>
<select name="product" onchange="selectProduct(this.form, 'product', 'component', '__Any__');">
<select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');">
<option value="">__Any__</option>
[% FOREACH prod = products %]
<option value="[% prod.name FILTER html %]"
......
......@@ -31,8 +31,8 @@
.inactive { color: #787878; }
.multiplicable { display: block; }
"
onload="selectProduct(document.forms[0], 'product', 'component', '__All__');"
javascript_urls=["productmenu.js"]
onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, '__All__');"
javascript_urls=["js/productform.js"]
%]
<p>
......@@ -60,7 +60,7 @@
<tr>
<th><label for="product">Product:</label></th>
<td>
<select name="product" onchange="selectProduct(this.form, 'product', 'component', '__Any__');">
<select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');">
<option value="">__Any__</option>
[% FOREACH prod = products %]
<option value="[% prod.name FILTER html %]"
......
......@@ -22,12 +22,14 @@
[%# The javascript block gets used in header.html.tmpl. %]
[% javascript = BLOCK %]
var usetms = 0; // do we have target milestone?
var first_load = 1; // is this the first time we load the page?
var last_sel = []; // caches last selection
var useclassification = false; // No classification level in use
var first_load = true; // Is this the first time we load the page?
var last_sel = []; // Caches last selection
var cpts = new Array();
[% n = 1 %]
[% FOREACH prod = products %]
cpts['[% prod.name FILTER js %]'] = [
cpts['[% n %]'] = [
[%- FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
[% n = n+1 %]
[% END %]
[% END %]
......@@ -32,8 +32,8 @@
table.requests th { text-align: left; }
table#filtering th { text-align: right; }
"
onload="selectProduct(document.forms[0], 'product', 'component', 'Any');"
javascript_urls=["productmenu.js"]
onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, 'Any');"
javascript_urls=["js/productform.js"]
%]
<p>
......@@ -53,7 +53,7 @@ to some group are shown by default.
title="Requester's email address"></td>
<th>Product:</th>
<td>
<select name="product" onchange="selectProduct(this.form, 'product', 'component', 'Any');">
<select name="product" onchange="selectProduct(this, this.form.component, null, null, 'Any');">
<option value="">Any</option>
[% FOREACH prod = products %]
<option value="[% prod.name FILTER html %]"
......
......@@ -93,12 +93,12 @@ function doOnSelectProduct(selectmode) {
if (useclassification && f.classification.selectedIndex > -1) {
selectClassification(f.classification, f.product, f.component, f.version, milestone);
} else {
selectProduct(f.product, f.component, f.version, milestone);
selectProduct(f.product, f.component, f.version, milestone, null);
}
} else if (selectmode == 1) {
selectClassification(f.classification, f.product, f.component, f.version, milestone);
} else {
selectProduct(f.product, f.component, f.version, milestone);
selectProduct(f.product, f.component, f.version, milestone, null);
}
}
......
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