summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorKent Rogers <kar@cray.com>2010-07-05 23:49:52 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-05 23:49:52 +0200
commitbcab6fcb10aa88683490bef03c607173f9c0b063 (patch)
treea7ed63d95f2cdce804e79e9869d813fda121a06a /js
parent65528cc7177689bee757fd26510bbb2a10954931 (diff)
downloadbugzilla-bcab6fcb10aa88683490bef03c607173f9c0b063.tar.gz
bugzilla-bcab6fcb10aa88683490bef03c607173f9c0b063.tar.xz
Bug 514618: Allow restricting the visibility and values of fields by
classification. r=mkanat, r=timello, a=mkanat
Diffstat (limited to 'js')
-rw-r--r--js/field.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/field.js b/js/field.js
index 20485bcc8..0ca59918a 100644
--- a/js/field.js
+++ b/js/field.js
@@ -375,6 +375,20 @@ function updateCommentTagControl(checkbox, form) {
}
/**
+ * Reset the value of the classification field and fire an event change
+ * on it. Called when the product changes, in case the classification
+ * field (which is hidden) controls the visibility of any other fields.
+ */
+function setClassification() {
+ var classification = document.getElementById('classification');
+ var product = document.getElementById('product');
+ var selected_product = product.value;
+ var select_classification = all_classifications[selected_product];
+ classification.value = select_classification;
+ bz_fireEvent(classification, 'change');
+}
+
+/**
* Says that a field should only be displayed when another field has
* a certain value. May only be called after the controller has already
* been added to the DOM.