From c269b4958746db8e4f035536112e871387e3040d Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 19 Aug 2011 08:53:39 -0400
Subject: [PATCH] - Improve setting upload form attributes, IE7 uses 'encoding' attribute instead of 'enctype'
---
program/js/app.js | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/program/js/app.js b/program/js/app.js
index d15950d..6da5a57 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -5833,11 +5833,12 @@
// handle upload errors, parsing iframe content in onload
$(frame_name).bind('load', {ts:ts}, onload);
- form.target = frame_name;
- form.action = this.url(action, { _id:this.env.compose_id||'', _uploadid:ts });
- form.setAttribute('method', 'POST');
- form.setAttribute('enctype', 'multipart/form-data');
- form.submit();
+ $(form).attr({
+ target: frame_name,
+ action: this.url(action, { _id:this.env.compose_id||'', _uploadid:ts }),
+ method: 'POST'})
+ .attr(form.encoding ? 'encoding' : 'enctype', 'multipart/form-data')
+ .submit();
return frame_name;
};
--
Gitblit v1.9.1