summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorwjames5 <will@tekimaki.com>2008-07-03 17:48:02 +0000
committerwjames5 <will@tekimaki.com>2008-07-03 17:48:02 +0000
commit6737f74b0cfe43a23855a9be66495642efcb29a2 (patch)
tree7273260443e0d0efe9a9603e52eb0d93d71644f6 /scripts
parent005f81b0bb6d11789cbaa057d85e78c009146397 (diff)
downloadliberty-6737f74b0cfe43a23855a9be66495642efcb29a2.tar.gz
liberty-6737f74b0cfe43a23855a9be66495642efcb29a2.tar.bz2
liberty-6737f74b0cfe43a23855a9be66495642efcb29a2.zip
properly clear file upload field by replacing input
Diffstat (limited to 'scripts')
-rw-r--r--scripts/LibertyAttachment.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/LibertyAttachment.js b/scripts/LibertyAttachment.js
index 93eb640..a2222f9 100644
--- a/scripts/LibertyAttachment.js
+++ b/scripts/LibertyAttachment.js
@@ -1,6 +1,11 @@
/* Dependencies: MochiKit Base Async, BitAjax.j */
LibertyAttachment = {
+ "fileInputClone":null,
"uploader_under_way":0,
+
+ "uploaderSetup":function(fileid){
+ LibertyAttachment.fileInputClone = $(fileid).cloneNode(true);
+ },
"uploader": function(file, action, waitmsg, frmid, cform) {
if (LibertyAttachment.uploader_under_way) {
@@ -12,13 +17,10 @@ LibertyAttachment = {
var old_target = file.form.target;
file.form.target = frmid;
var old_action = file.form.action;
- // var action_item = document.getElementById(actionid);
- // action_item.value = old_action;
file.form.action=action;
file.form.submit();
file.form.target = old_target;
file.form.action = old_action;
- // action_item.value = '';
}
}
},
@@ -65,7 +67,10 @@ LibertyAttachment = {
}
LibertyAttachment.uploader_under_way = 0;
var file = document.getElementById(fileid);
- file.value = '';
+ LibertyAttachment.fileInputClone.id = fileid;
+ MochiKit.DOM.swapDOM(file, LibertyAttachment.fileInputClone);
+ LibertyAttachment.uploaderSetup( fileid );
+ // file.value = '';
}
},