Changeset f5521a4 in github


Ignore:
Timestamp:
Dec 30, 2011 11:02:24 AM (17 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
Children:
822a1ef
Parents:
e193a02
Message:

Add button to clone file upload fields for mutli-file uploads

Location:
skins/larry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skins/larry/mail.css

    r84d9b15 rf5521a4  
    11111111} 
    11121112 
    1113  
    1114  
     1113#uploadform a.iconlink { 
     1114        margin-left: 1em; 
     1115        text-indent: -1000px; 
     1116} 
     1117 
     1118#uploadform form div { 
     1119        margin: 4px 0; 
     1120} 
     1121 
  • skins/larry/ui.js

    r847d310 rf5521a4  
    533533      return; 
    534534    } 
     535     
     536    // add icons to clone file input field 
     537    if (rcmail.env.action = 'compose' && !$dialog.data('extended')) { 
     538      $('<a>') 
     539        .addClass('iconlink add') 
     540        .attr('href', '#add') 
     541        .html('Add') 
     542        .appendTo($('input[type="file"]', $dialog).parent()) 
     543        .click(add_uploadfile); 
     544      $dialog.data('extended', true); 
     545    } 
    535546 
    536547    $dialog.dialog({ 
     
    544555 
    545556        $dialog.dialog('destroy').hide(); 
     557        $('div.addline', $dialog).remove(); 
    546558      }, 
    547559      width: 480 
     
    549561 
    550562    if (!document.all) 
    551       $('input[type=file]', $dialog).click(); 
    552   } 
     563      $('input[type=file]', $dialog).first().click(); 
     564  } 
     565 
     566  function add_uploadfile(e) 
     567  { 
     568    var div = $(this).parent(); 
     569    var clone = div.clone().addClass('addline').insertAfter(div); 
     570    clone.children('.iconlink').click(add_uploadfile); 
     571    clone.children('input').val(''); 
     572 
     573    if (!document.all) 
     574      $('input[type=file]', clone).click(); 
     575  } 
     576 
    553577 
    554578  /** 
Note: See TracChangeset for help on using the changeset viewer.