summaryrefslogtreecommitdiff
path: root/skins/larry/ui.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-12-30 16:02:24 +0000
committerthomascube <thomas@roundcube.net>2011-12-30 16:02:24 +0000
commitf5521a4a6d2132f8fe49c66858326e00e9a68b84 (patch)
treee23dc14633efc5ea53479670617859fa0a9cde5d /skins/larry/ui.js
parente193a0272ecdc15badda1d851d95a2ac6b50a9aa (diff)
Add button to clone file upload fields for mutli-file uploads
Diffstat (limited to 'skins/larry/ui.js')
-rw-r--r--skins/larry/ui.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index c24915eef..8038aa78e 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -532,6 +532,17 @@ function rcube_mail_ui()
$dialog.dialog('close');
return;
}
+
+ // add icons to clone file input field
+ if (rcmail.env.action = 'compose' && !$dialog.data('extended')) {
+ $('<a>')
+ .addClass('iconlink add')
+ .attr('href', '#add')
+ .html('Add')
+ .appendTo($('input[type="file"]', $dialog).parent())
+ .click(add_uploadfile);
+ $dialog.data('extended', true);
+ }
$dialog.dialog({
modal: true,
@@ -543,14 +554,27 @@ function rcube_mail_ui()
catch(e){ } // ignore errors
$dialog.dialog('destroy').hide();
+ $('div.addline', $dialog).remove();
},
width: 480
}).show();
if (!document.all)
- $('input[type=file]', $dialog).click();
+ $('input[type=file]', $dialog).first().click();
+ }
+
+ function add_uploadfile(e)
+ {
+ var div = $(this).parent();
+ var clone = div.clone().addClass('addline').insertAfter(div);
+ clone.children('.iconlink').click(add_uploadfile);
+ clone.children('input').val('');
+
+ if (!document.all)
+ $('input[type=file]', clone).click();
}
+
/**
*
*/