Ignore:
Timestamp:
07/11/12 17:39:49 (12 years ago)
Author:
gustavo
Message:

Ticket #2953 - Melhorar a disposição da listagem de anexos no expressoMail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js

    r6752 r6760  
    43844384                                attach.fileSize = formatBytes(file.size); 
    43854385                                if(maxAttachmentSize && file.size > maxAttachmentSize) 
    4386                                         attach.error = 'Tamanho de arquivo nao permitido!!' 
     4386                                        attach.error = 'Tamanho de arquivo nao permitido' 
    43874387                                else 
    4388                                         attach.error = 'Loading...';     
     4388                                        attach.error = true; 
    43894389                                var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));                            
    43904390                                upload.find('.att-box-delete').click(function(){ 
     
    44234423                                                        radius: 5 
    44244424                                                }, 
    4425                                                 padding: 5,  
    4426                                                 textAlign: 'center', 
     4425                                                padding: 3,  
     4426                                                textAlign: 'left', 
    44274427                                                tip: true, // Give it a speech bubble tip with automatic corner detection 
    4428                                                 name: 'blue' // Style it according to the preset 'cream' style 
     4428                                                name: (typeof(attach.error) == 'boolean' ? 'light' : 'red') // Style it according to the preset 'cream' style 
    44294429                                        } 
    44304430                }); 
     
    44404440                }, 
    44414441                done: function(e, data){ 
     4442            var attach_box = fileUploadMSG.find('.att-box-loading:first').parents('.att-box'); 
     4443            var attach = { 
     4444                fullFileName : attach_box.find(".att-box-fullfilename").text(), 
     4445                fileSize : attach_box.find(".att-box-filesize").text(), 
     4446                OK : true, 
     4447                error : false 
     4448            }; 
    44424449                        if(!!data.result && data.result != "[]" ){ 
    44434450                                var newAttach = data.result;                              
    4444                                 if(!newAttach.mailAttachment.error){ 
    4445                                         if(newAttach.rollback !== false) 
    4446                                         { 
    4447                                                 fileUploadMSG.find('.att-box-loading:first').parents('div:first').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>'); 
    4448                                                 addAttachment(ID,newAttach['mailAttachment'][0][0].id); 
    4449                                         } 
    4450                                         else                              
    4451                                                 fileUploadMSG.find('.att-box-loading:first').parents('div:first').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');    
    4452                                 }else{ 
    4453                                         fileUploadMSG.find('.att-box-loading:first').parents('div:first').find('.status-upload').append(newAttach.mailAttachment.error).addClass('message-attach-error');    
    4454                                 } 
    4455                                  
     4451                                if(!newAttach.mailAttachment.error || newAttach.rollback !== false){ 
     4452                                        attach_box.append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>'); 
     4453                                        addAttachment(ID,newAttach['mailAttachment'][0][0].id); 
     4454                }else { 
     4455                                    attach_box.addClass('invalid-email-box'); 
     4456                    attach.error = newAttach.mailAttachment.error ? newAttach.mailAttachment.error : 'Erro ao anexar...';//.append(newAttach.mailAttachment.error).addClass('message-attach-error');    
     4457                } 
    44564458                        }else { 
    4457                                 fileUploadMSG.find(' .progress.on-complete:first').parents('div:first').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error'); 
    4458                         } 
     4459                                attach_box.addClass('invalid-email-box');//.qtip("api").updateContent("oi", true); 
     4460                attach.error = 'Erro ao anexar...'; 
     4461                        } 
     4462            attach_box.qtip("destroy").qtip({ 
     4463                content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}), 
     4464                position: { 
     4465                    corner: { 
     4466                        tooltip: 'bottomMiddle', 
     4467                        target: 'topMiddle' 
     4468                    }, 
     4469                    adjust: { 
     4470                       resize: true, 
     4471                       scroll: true 
     4472                    } 
     4473                }, 
     4474                show: { 
     4475                    when: 'mouseover', // Don't specify a show event 
     4476                    ready: false // Show the tooltip when ready 
     4477                }, 
     4478                hide: 'mouseout', // Don't specify a hide event 
     4479                style: { 
     4480                    border: { 
     4481                        width: 1, 
     4482                        radius: 5 
     4483                    }, 
     4484                    padding: 3,  
     4485                    textAlign: 'left', 
     4486                    tip: true, // Give it a speech bubble tip with automatic corner detection 
     4487                    name: (attach.error == false ? 'blue' : 'red')// Style it according to the preset 'cream' style 
     4488                } 
     4489            }); 
    44594490            fileUploadMSG.find(' .att-box-loading:first').remove(); 
    44604491                } 
Note: See TracChangeset for help on using the changeset viewer.