Fix iframe onload for upload errors handling (#1489379)

pull/138/head
Aleksander Machniak 11 years ago
parent 0ce501c567
commit ff993eb483

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Fix iframe onload for upload errors handling (#1489379)
- Fix address matching in Return-Path header on identity selection (#1489374) - Fix address matching in Return-Path header on identity selection (#1489374)
- Fix HTML part detection when encapsulated inside multipart/signed (#1489372) - Fix HTML part detection when encapsulated inside multipart/signed (#1489372)
- Fix text wrapping issue with long unwrappable lines (#1489371) - Fix text wrapping issue with long unwrappable lines (#1489371)

@ -6534,7 +6534,7 @@ function rcube_webmail()
// post the given form to a hidden iframe // post the given form to a hidden iframe
this.async_upload_form = function(form, action, onload) this.async_upload_form = function(form, action, onload)
{ {
var ts = new Date().getTime(), var frame, ts = new Date().getTime(),
frame_name = 'rcmupload'+ts; frame_name = 'rcmupload'+ts;
// upload progress support // upload progress support
@ -6553,21 +6553,19 @@ function rcube_webmail()
// have to do it this way for IE // have to do it this way for IE
// otherwise the form will be posted to a new window // otherwise the form will be posted to a new window
if (document.all) { if (document.all) {
var html = '<iframe name="'+frame_name+'" src="program/resources/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>'; document.body.insertAdjacentHTML('BeforeEnd', '<iframe name="'+frame_name+'"'
document.body.insertAdjacentHTML('BeforeEnd', html); + ' src="program/resources/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>');
frame = $('iframe[name="'+frame_name+'"]');
} }
else { // for standards-compilant browsers // for standards-compliant browsers
var frame = document.createElement('iframe'); else {
frame.name = frame_name; frame = $('<iframe>').attr('name', frame_name)
frame.style.border = 'none'; .css({border: 'none', width: 0, height: 0, visibility: 'hidden'})
frame.style.width = 0; .appendTo(document.body);
frame.style.height = 0;
frame.style.visibility = 'hidden';
document.body.appendChild(frame);
} }
// handle upload errors, parsing iframe content in onload // handle upload errors, parsing iframe content in onload
$(frame_name).bind('load', {ts:ts}, onload); frame.bind('load', {ts:ts}, onload);
$(form).attr({ $(form).attr({
target: frame_name, target: frame_name,

Loading…
Cancel
Save