From: bbaetz%acm.org <>
Date: Fri, 29 May 2009 01:08:49 +0000 (+0000)
Subject: Bug 494741 - Toggling Add/Don't add attachment doesn't reset JS state
X-Git-Tag: bugzilla-3.4rc1~29
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfe29d41893cadea6a9d5ef99b6e0154fdb6b0c7;p=thirdparty%2Fbugzilla.git
Bug 494741 - Toggling Add/Don't add attachment doesn't reset JS state
---
diff --git a/js/attachment.js b/js/attachment.js
index c05d1d3ea6..2543316799 100644
--- a/js/attachment.js
+++ b/js/attachment.js
@@ -100,7 +100,12 @@ function clearAttachmentFields() {
URLFieldHandler();
}
document.getElementById('description').value = '';
- document.getElementById('ispatch').checked = '';
+ /* Fire onchange so that the disabled state of the content-type
+ * radio buttons are also reset
+ */
+ element = document.getElementById('ispatch');
+ element.checked = '';
+ bz_fireEvent(element, 'change');
if ((element = document.getElementById('isprivate')))
element.checked = '';
}
diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl
index 10648159b8..687cd7cbf2 100644
--- a/template/en/default/attachment/create.html.tmpl
+++ b/template/en/default/attachment/create.html.tmpl
@@ -33,9 +33,8 @@
title = title
header = header
subheader = subheader
- onload="setContentTypeDisabledState(document.entryform);"
style_urls = [ 'skins/standard/create_attachment.css' ]
- javascript_urls = [ "js/attachment.js" ]
+ javascript_urls = [ "js/attachment.js", "js/util.js" ]
doc_section = "attachments.html"
%]
diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl
index 2fc80a5184..2cef632d18 100644
--- a/template/en/default/attachment/createformcontents.html.tmpl
+++ b/template/en/default/attachment/createformcontents.html.tmpl
@@ -70,6 +70,12 @@
+ [%# Reset this whenever the page loads so that the JS state is up to date %]
+
Otherwise, choose a method for determining the content type.