##// END OF EJS Templates
Simplifies javascript for adding a new file....
Jean-Philippe Lang -
r6091:e6104d344fdc
parent child
Show More
@@ -86,26 +86,14 function hideFieldset(el) {
86 var fileFieldCount = 1;
86 var fileFieldCount = 1;
87
87
88 function addFileField() {
88 function addFileField() {
89 if (fileFieldCount >= 10) return false
89 if (fileFieldCount >= 10) return false
90 fileFieldCount++;
90 fileFieldCount++;
91 var f = document.createElement("input");
91 var fields = $('attachments_fields');
92 f.type = "file";
92 var s = document.createElement("span");
93 f.name = "attachments[" + fileFieldCount + "][file]";
93 s.update(fields.down('span').innerHTML);
94 f.size = 30;
94 s.down('input.file').name = "attachments[" + fileFieldCount + "][file]";
95 var d = document.createElement("input");
95 s.down('input.description').name = "attachments[" + fileFieldCount + "][description]";
96 d.type = "text";
96 fields.appendChild(s);
97 d.name = "attachments[" + fileFieldCount + "][description]";
98 d.size = 60;
99 var dLabel = new Element('label');
100 dLabel.addClassName('inline');
101 // Pulls the languge value used for Optional Description
102 dLabel.update($('attachment_description_label_content').innerHTML)
103 p = document.getElementById("attachments_fields");
104 p.appendChild(document.createElement("br"));
105 p.appendChild(f);
106 p.appendChild(dLabel);
107 dLabel.appendChild(d);
108
109 }
97 }
110
98
111 function showTab(name) {
99 function showTab(name) {
General Comments 0
You need to be logged in to leave comments. Login now