Commit b973fa3a authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 505015: Selections are not persistent across submissions - Patch by…

Bug 505015: Selections are not persistent across submissions - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
parent 908feaf0
......@@ -50,6 +50,7 @@ function subcatSelected() {
i++;
}
namewidget.disabled = false;
namewidget.options[0].selected = true;
checkNewState();
......@@ -98,23 +99,16 @@ function subcatSelected() {
<td>
<noscript>
<input type="submit" name="action-assemble" value="Update --&gt;"
id="action-assemble">
id="action-assemble2">
</noscript>
</td>
<td align="left">
<select name="name" id="name" style="width: 15em"
size="5" multiple="multiple"
[%+ "disabled=\"disabled\"" UNLESS name.keys.size %]>
[% FOREACH x = name.keys.sort %]
<option value="[% name.$x FILTER html %]">
[% x FILTER html %]</option>
[% END %]
[% UNLESS name.keys.size %]
<option value="" disabled="disabled"></option>
[% END %]
</select>
</td>
[% PROCESS series_select sel = { name => 'name',
size => 5,
multiple => 1,
# We want to use the series ID as value,
# not its name.
value_in_hash => 1 } %]
<td align="center" valign="middle">
<input type="submit" name="action-add" value="Add To List"
......@@ -124,14 +118,6 @@ function subcatSelected() {
[% END %]
</table>
<script type="text/javascript">
document.chartform.category[0].selected = true;
document.chartform.subcategory.disabled = '';
document.chartform.name.disabled = '';
catSelected();
subcatSelected();
</script>
<h3>List Of Data Sets To Plot</h3>
[% IF chart.lines.size > 0 %]
......
......@@ -48,7 +48,6 @@ var series = {
[% END %]
};
[%# Should attempt to preserve selection across invocations @@@ %]
[%# This function takes necessary action on selection of a category %]
function catSelected() {
var cat = document.chartform.category.value;
......@@ -67,7 +66,8 @@ function catSelected() {
[% IF newtext %]
subcatwidget.options[i] = new Option("[% newtext FILTER js %]", "");
[% END %]
subcatwidget.disabled = false;
subcatwidget.options[0].selected = true;
if (document.chartform.action[1]) {
......@@ -100,11 +100,13 @@ function checkNewState() {
<td align="left">
<select name="[% sel.name %]" id="[% sel.name %]"
size="[% sel.size %]" style="width: 15em"
[%+ 'multiple="multiple"' IF sel.multiple %]
[%+ "disabled=\"disabled\"" UNLESS ${sel.name}.keys.size || newtext %]
[%+ "onchange=\"$sel.onchange\"" IF sel.onchange %]>
[% FOREACH x = ${sel.name}.keys.sort %]
<option value="[% x FILTER html %]"
[% " selected" IF default.${sel.name} == x %]>
[% value = sel.value_in_hash ? ${sel.name}.$x : x %]
<option value="[% value FILTER html %]"
[% " selected" IF default.${sel.name} == value %]>
[% x FILTER html %]</option>
[% END %]
[% IF newtext %]
......
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