aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-06-21 19:33:40 +0000
committermkanat%bugzilla.org <>2009-06-21 19:33:40 +0000
commit6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f (patch)
tree09210e7401d57785effcc9b8bd86c2642f8a1d8d /template/en/default/bug
parent4c3c583a411a59ae42df2652c8122fcfd5364c52 (diff)
downloadbugs-6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f.tar
bugs-6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f.tar.gz
bugs-6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f.tar.bz2
bugs-6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f.tar.xz
bugs-6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f.zip
Bug 463598: Improve the performance of the JavaScript that adjusts field values based on the value of another field
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=wicked, a=mkanat
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/field-events.js.tmpl12
-rw-r--r--template/en/default/bug/field.html.tmpl5
2 files changed, 11 insertions, 6 deletions
diff --git a/template/en/default/bug/field-events.js.tmpl b/template/en/default/bug/field-events.js.tmpl
index 7cdf64687..06fba1245 100644
--- a/template/en/default/bug/field-events.js.tmpl
+++ b/template/en/default/bug/field-events.js.tmpl
@@ -27,10 +27,14 @@
'[% controlled_field.visibility_value.name FILTER js %]');
[% END %]
[% FOREACH legal_value = field.legal_values %]
- [% FOREACH controlled_value = legal_value.controlled_values %]
- showValueWhen('[% controlled_value.field.name FILTER js %]',
- '[% controlled_value.name FILTER js %]',
+ [% FOREACH controlled_field = legal_value.controlled_values.keys %]
+ [% SET cont_ids = [] %]
+ [% FOREACH val = legal_value.controlled_values.$controlled_field %]
+ [% cont_ids.push(val.id) %]
+ [% END %]
+ showValueWhen('[% controlled_field FILTER js %]',
+ [[% cont_ids.join(',') FILTER js %]],
'[% field.name FILTER js %]',
- '[% legal_value.name FILTER js %]');
+ [% legal_value.id FILTER js %]);
[% END %]
[% END %]
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index 1d5a194e2..21a73a805 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -134,6 +134,8 @@
[% SET control_value = legal_value.visibility_value %]
[% SET control_field = field.value_field %]
<option value="[% legal_value.name FILTER html %]"
+ id="v[% legal_value.id FILTER html %]_
+ [%- field.name FILTER html %]"
[%# We always show selected values, even if they should be
# hidden %]
[% IF value.contains(legal_value.name).size %]
@@ -144,8 +146,7 @@
%]
class="bz_hidden_option" disabled="disabled"
[% END %]>
- [%- legal_value.name FILTER html -%]
- </option>
+ [%- legal_value.name FILTER html %]</option>
[% END %]
</select>
[%# When you pass an empty multi-select in the web interface,