Changeset 5856


Ignore:
Timestamp:
03/30/12 18:02:50 (12 years ago)
Author:
cristiano
Message:

Ticket #2581 - correções no drop-draw de anexar arquivos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/draw_api.js

    r5846 r5856  
    41844184                                setTimeout(function() { 
    41854185                                        $('#attDisposition'+ID).val('attachment'); 
     4186                                        delete data.fileInput;  
    41864187                                        data.submit(); 
    41874188                                }, 5000); 
    4188                         } 
     4189                        }                
     4190                        var attach = {}; 
     4191                        attach.fullFileName = data.files[0].name; 
     4192                        attach.fileName = data.files[0].name; 
     4193                        if(data.files[0].name.length > 50) 
     4194                                attach.fileName = data.files[0].name.substr(0, 32) + " ... " + data.files[0].name.substr(data.files[0].name.length-9, data.files[0].name.length); 
     4195                        attach.fileSize = formatBytes(data.files[0].size); 
     4196                        if(maxAttachmentSise && data.files[0].size > maxAttachmentSise) 
     4197                                attach.error = 'Tamanho de arquivo nao permitido!!' 
     4198 
     4199                        var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));                            
     4200                        upload.find('.button.close').button({ 
     4201                                icons: { 
     4202                                        primary: "ui-icon-close" 
     4203                                }, 
     4204                                text: false 
     4205                        }).click(function(){ 
     4206                                var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 
     4207                                fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 
     4208                                delAttachment(ID, idAttach) 
     4209                                $(this).parent().remove(); 
     4210                        }); 
     4211 
     4212                        fileUploadMSG.find('.attachments-list').append(upload); 
     4213 
     4214                        if(!maxAttachmentSise || data.files[0].size < maxAttachmentSise) 
     4215                            fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden');      
     4216                        else 
     4217                            fileUploadMSG.find(' .fileinput-button.new').removeClass('new'); 
    41894218                }, 
    4190                 change: function (e, data) { 
    4191                         $.each(data.files, function (index, file) { 
    4192                                 var attach = {}; 
    4193                                 attach.fullFileName = file.name; 
    4194                                 attach.fileName = file.name; 
    4195                                 if(file.name.length > 50) 
    4196                                         attach.fileName = file.name.substr(0, 32) + " ... " + file.name.substr(file.name.length-9, file.name.length); 
    4197                                 attach.fileSize = formatBytes(file.size); 
    4198                                 if(maxAttachmentSise && file.size > maxAttachmentSise) 
    4199                                         attach.error = 'Tamanho de arquivo nao permitido!!' 
    4200                                  
    4201                                 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));                            
    4202                                 upload.find('.button.close').button({ 
    4203                                         icons: { 
    4204                                                 primary: "ui-icon-close" 
    4205                                         }, 
    4206                                         text: false 
    4207                                 }).click(function(){ 
    4208                                         var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 
    4209                                         fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 
    4210                                         delAttachment(ID, idAttach) 
    4211                                         $(this).parent().remove(); 
    4212                                 }); 
    4213                                  
    4214                                 fileUploadMSG.find('.attachments-list').append(upload); 
    4215  
    4216                                 if(!maxAttachmentSise || file.size < maxAttachmentSise){ 
    4217                                         fileUploadMSG.find('.fileinput-button.new').append(data.fileInput[0]).removeClass('new'); 
    4218                                         fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden');  
    4219                                 }else 
    4220                                         fileUploadMSG.find(' .fileinput-button.new').removeClass('new'); 
    4221  
    4222                 })}, 
    4223  
    42244219                done: function(e, data){ 
    42254220                        if(!!data.result && data.result != "[]" ){ 
     
    42414236                } 
    42424237        }).find('[name="files[]"]').css({"height" : "20px", "width": "100px", "border-width": "0 0 0px 0px", "-moz-transform" : "none","-o-transform" : 'none'}); 
    4243  
    4244                  
     4238         
    42454239       fileUploadMSG.find("span.message-attach-link").click(function(event){ 
    42464240                jQuery('#message-attach-dialog').html(DataLayer.render("../prototype/modules/attach_message/attach_message.ejs", {})); 
Note: See TracChangeset for help on using the changeset viewer.