summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorReed Loden <reed@reedloden.com>2010-06-29 05:14:10 +0200
committerReed Loden <reed@reedloden.com>2010-06-29 05:14:10 +0200
commitcbbcceb2a69d48737fac00639421d53f92c61c64 (patch)
tree178a8874bb4470700653b2082062be517245a9cf /js
parent86f63e23d89463172f8814f3dfa6ac2b0005fd6c (diff)
downloadbugzilla-cbbcceb2a69d48737fac00639421d53f92c61c64.tar.gz
bugzilla-cbbcceb2a69d48737fac00639421d53f92c61c64.tar.xz
Bug 179626 - Hide, rather than disable, requestee fields when the flags aren't in the "?" state.
[r=mkanat a=mkanat]
Diffstat (limited to 'js')
-rw-r--r--js/flag.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/js/flag.js b/js/flag.js
index a0ea34910..64b4ad8a2 100644
--- a/js/flag.js
+++ b/js/flag.js
@@ -24,7 +24,7 @@
*
* ***** END LICENSE BLOCK ***** */
-// Enables or disables a requestee field depending on whether or not
+// Shows or hides a requestee field depending on whether or not
// the user is requesting the corresponding flag.
function toggleRequesteeField(flagField, no_focus)
{
@@ -34,18 +34,18 @@ function toggleRequesteeField(flagField, no_focus)
var requesteeField = document.getElementById(id);
if (!requesteeField) return;
- // Enable or disable the requestee field based on the value
+ // Show or hide the requestee field based on the value
// of the flag field.
if (flagField.value == "?") {
- requesteeField.disabled = false;
+ YAHOO.util.Dom.removeClass(requesteeField.parentNode, 'bz_default_hidden');
if (!no_focus) requesteeField.focus();
} else
- requesteeField.disabled = true;
+ YAHOO.util.Dom.addClass(requesteeField.parentNode, 'bz_default_hidden');
}
-// Disables requestee fields when the window is loaded since they shouldn't
+// Hides requestee fields when the window is loaded since they shouldn't
// be enabled until the user requests that flag type.
-function disableRequesteeFields()
+function hideRequesteeFields()
{
var inputElements = document.getElementsByTagName("input");
var selectElements = document.getElementsByTagName("select");
@@ -68,8 +68,8 @@ function disableRequesteeFields()
id = inputElement.name.replace(/requestee(_type)?-(\d+)/, "flag$1-$2");
flagField = document.getElementById(id);
if (flagField && flagField.value != "?")
- inputElement.disabled = true;
+ YAHOO.util.Dom.addClass(inputElement.parentNode, 'bz_default_hidden');
}
}
}
-YAHOO.util.Event.addListener(window, "load", disableRequesteeFields);
+YAHOO.util.Event.onDOMReady(hideRequesteeFields);