From 64fa955059a8dffe553c01a05115afed1c91e8f2 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sun, 25 Jul 2010 16:39:10 -0400
Subject: [PATCH] Surround attachment form cleaning with try/catch

---
 skins/default/functions.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/skins/default/functions.js b/skins/default/functions.js
index 47eb1fc..b39324e 100644
--- a/skins/default/functions.js
+++ b/skins/default/functions.js
@@ -88,8 +88,12 @@
 {
   if (typeof show == 'object') // called as event handler
     show = false;
-  if (!show)
-    $('#attachment-form input[type=file]').val('');
+
+  // clear upload form
+  if (!show) {
+    try { $('#attachment-form form')[0].reset(); }
+    catch(e){}  // ignore errors
+  }
 
   this.show_popupmenu('uploadmenu', show);
 

--
Gitblit v1.9.1