summaryrefslogtreecommitdiffstats
path: root/extensions/ComponentWatching/template/en/default/account
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-04-09 16:49:29 +0200
committerByron Jones <bjones@mozilla.com>2012-04-09 16:49:29 +0200
commit038e32c1753b1d7bfbf026ee99f6128e038cc70c (patch)
treef3c5f8dcd55ae2af988605b9581b11561de9310c /extensions/ComponentWatching/template/en/default/account
parent304df9d6e97140b7a717176302be5d407266b03d (diff)
downloadbugzilla-038e32c1753b1d7bfbf026ee99f6128e038cc70c.tar.gz
bugzilla-038e32c1753b1d7bfbf026ee99f6128e038cc70c.tar.xz
Bug 738329: allow preseleting products and components in component-watch prefs
Diffstat (limited to 'extensions/ComponentWatching/template/en/default/account')
-rw-r--r--extensions/ComponentWatching/template/en/default/account/prefs/component_watch.html.tmpl15
1 files changed, 12 insertions, 3 deletions
diff --git a/extensions/ComponentWatching/template/en/default/account/prefs/component_watch.html.tmpl b/extensions/ComponentWatching/template/en/default/account/prefs/component_watch.html.tmpl
index 46acd386f..0eed6b3b3 100644
--- a/extensions/ComponentWatching/template/en/default/account/prefs/component_watch.html.tmpl
+++ b/extensions/ComponentWatching/template/en/default/account/prefs/component_watch.html.tmpl
@@ -46,6 +46,13 @@ function onSelectProduct() {
// support IE
component.add(new Option('__Any__', ''), 0);
}
+ if ('[% add_component FILTER js %]' != ''
+ && bz_valueSelected(Dom.get('product'), '[% add_product FILTER js %]')
+ ) {
+ var index = bz_optionIndex(Dom.get('component'), '[% add_component FILTER js %]');
+ if (index != -1)
+ Dom.get('component').options[index].selected = true;
+ }
onSelectComponent();
}
@@ -75,7 +82,8 @@ watch "__Any__".
<td colspan="2">
<select name="add_product" id="product" onChange="onSelectProduct()">
[% FOREACH product IN selectable_products %]
- <option>[% product.name FILTER html %]</option>
+ <option [% 'selected' IF add_product == product.name %]>
+ [%~ product.name FILTER html %]</option>
[% END %]
</select>
</td>
@@ -83,11 +91,12 @@ watch "__Any__".
<tr>
<td align="right" valign="top">Component:</td>
<td>
- <select name="add_component" id="component" multiple size="5" onChange="onSelectComponent()">
+ <select name="add_component" id="component" multiple size="10" onChange="onSelectComponent()">
<option value="">__Any__</option>
[% FOREACH product IN selectable_products %]
[% FOREACH component IN product.components %]
- <option>[% component.name FILTER html %]</option>
+ <option [% 'selected' IF add_component == component.name %]>
+ [%~ component.name FILTER html %]</option>
[% END %]
[% END %]
</select>