From 64fa955059a8dffe553c01a05115afed1c91e8f2 Mon Sep 17 00:00:00 2001 From: thomascube Date: Sun, 25 Jul 2010 20:39:10 +0000 Subject: Surround attachment form cleaning with try/catch --- skins/default/functions.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'skins') diff --git a/skins/default/functions.js b/skins/default/functions.js index 47eb1fc4e..b39324ef9 100644 --- a/skins/default/functions.js +++ b/skins/default/functions.js @@ -88,8 +88,12 @@ uploadmenu: function(show) { 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); -- cgit v1.2.3