Simplifies javascript for adding a new file.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6211 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f208fcecca
commit
e6104d344f
|
@ -86,26 +86,14 @@ function hideFieldset(el) {
|
||||||
var fileFieldCount = 1;
|
var fileFieldCount = 1;
|
||||||
|
|
||||||
function addFileField() {
|
function addFileField() {
|
||||||
if (fileFieldCount >= 10) return false
|
if (fileFieldCount >= 10) return false
|
||||||
fileFieldCount++;
|
fileFieldCount++;
|
||||||
var f = document.createElement("input");
|
var fields = $('attachments_fields');
|
||||||
f.type = "file";
|
var s = document.createElement("span");
|
||||||
f.name = "attachments[" + fileFieldCount + "][file]";
|
s.update(fields.down('span').innerHTML);
|
||||||
f.size = 30;
|
s.down('input.file').name = "attachments[" + fileFieldCount + "][file]";
|
||||||
var d = document.createElement("input");
|
s.down('input.description').name = "attachments[" + fileFieldCount + "][description]";
|
||||||
d.type = "text";
|
fields.appendChild(s);
|
||||||
d.name = "attachments[" + fileFieldCount + "][description]";
|
|
||||||
d.size = 60;
|
|
||||||
var dLabel = new Element('label');
|
|
||||||
dLabel.addClassName('inline');
|
|
||||||
// Pulls the languge value used for Optional Description
|
|
||||||
dLabel.update($('attachment_description_label_content').innerHTML)
|
|
||||||
p = document.getElementById("attachments_fields");
|
|
||||||
p.appendChild(document.createElement("br"));
|
|
||||||
p.appendChild(f);
|
|
||||||
p.appendChild(dLabel);
|
|
||||||
dLabel.appendChild(d);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showTab(name) {
|
function showTab(name) {
|
||||||
|
|
Loading…
Reference in New Issue