Commit 38cbb6ac authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 695514: Slow performance in field-events.js.tmpl on show_bug.cgi with large number of products

r=dkl a=LpSolit
parent f0e69404
...@@ -231,7 +231,7 @@ TUI_hide_default('attachment_text_field'); ...@@ -231,7 +231,7 @@ TUI_hide_default('attachment_text_field');
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
[%+ INCLUDE "bug/field-events.js.tmpl" [%+ INCLUDE "bug/field-events.js.tmpl"
field = bug_fields.component %] field = bug_fields.component, product = product %]
//--> //-->
</script> </script>
</td> </td>
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
[%# INTERFACE: [%# INTERFACE:
# field: a Bugzilla::Field object # field: a Bugzilla::Field object
# product: (optional) a Bugzilla::Product object. When specified,
# components are restricted to this product.
#%] #%]
[% FOREACH controlled_field = field.controls_visibility_of %] [% FOREACH controlled_field = field.controls_visibility_of %]
...@@ -18,7 +20,15 @@ ...@@ -18,7 +20,15 @@
[%- END %] [%- END %]
]); ]);
[% END %] [% END %]
[% FOREACH legal_value = field.legal_values %]
[% legal_values = [] %]
[% IF field.name == "component" AND product %]
[% legal_values = product.components %]
[% ELSE %]
[% legal_values = field.legal_values %]
[% END %]
[% FOREACH legal_value = legal_values %]
[% FOREACH controlled_field = legal_value.controlled_values.keys %] [% FOREACH controlled_field = legal_value.controlled_values.keys %]
[% SET cont_ids = [] %] [% SET cont_ids = [] %]
[% FOREACH val = legal_value.controlled_values.$controlled_field %] [% FOREACH val = legal_value.controlled_values.$controlled_field %]
......
...@@ -133,7 +133,8 @@ ...@@ -133,7 +133,8 @@
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
initHidingOptionsForIE('[% field.name FILTER js %]'); initHidingOptionsForIE('[% field.name FILTER js %]');
[%+ INCLUDE "bug/field-events.js.tmpl" field = field %] [%+ INCLUDE "bug/field-events.js.tmpl"
field = field, product = bug.product_obj %]
//--> //-->
</script> </script>
......
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