From 771a82df9031485b3f9e7decf6b263c6847507b1 Mon Sep 17 00:00:00 2001
From: Thomas B. <thomas@roundcube.net>
Date: Fri, 18 Oct 2013 15:40:17 -0400
Subject: [PATCH] Merge pull request #139 from qnrq/master

---
 program/js/app.js |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 7fbab80..ac49b4e 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3559,6 +3559,7 @@
     }
 
     this.env.identity = id;
+    this.triggerEvent('change_identity');
     return true;
   };
 
@@ -6534,7 +6535,7 @@
   // post the given form to a hidden iframe
   this.async_upload_form = function(form, action, onload)
   {
-    var ts = new Date().getTime(),
+    var frame, ts = new Date().getTime(),
       frame_name = 'rcmupload'+ts;
 
     // upload progress support
@@ -6553,21 +6554,19 @@
     // have to do it this way for IE
     // otherwise the form will be posted to a new window
     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', html);
+      document.body.insertAdjacentHTML('BeforeEnd', '<iframe name="'+frame_name+'"'
+        + ' src="program/resources/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>');
+      frame = $('iframe[name="'+frame_name+'"]');
     }
-    else { // for standards-compilant browsers
-      var frame = document.createElement('iframe');
-      frame.name = frame_name;
-      frame.style.border = 'none';
-      frame.style.width = 0;
-      frame.style.height = 0;
-      frame.style.visibility = 'hidden';
-      document.body.appendChild(frame);
+    // for standards-compliant browsers
+    else {
+      frame = $('<iframe>').attr('name', frame_name)
+        .css({border: 'none', width: 0, height: 0, visibility: 'hidden'})
+        .appendTo(document.body);
     }
 
     // handle upload errors, parsing iframe content in onload
-    $(frame_name).bind('load', {ts:ts}, onload);
+    frame.bind('load', {ts:ts}, onload);
 
     $(form).attr({
         target: frame_name,

--
Gitblit v1.9.1