Ignore:
Timestamp:
04/25/12 10:33:45 (12 years ago)
Author:
marcieli
Message:

Ticket #2633 - Ao criar novo marcador, duplica na lista da tela de configuração

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/mail/js/label.js

    r6013 r6023  
    262262        $(".add-label-button").removeClass("ui-icon ui-icon-plus") 
    263263        .html('<img alt="Carregando" title="Carregando" style="margin-left:10px;" src="../prototype/modules/mail/img/loader.gif" />'); 
    264          
     264        var hasLabel = true; 
     265        var labelId; 
    265266        DataLayer.commit(false, false, function(data){ 
    266                 var hasLabel = true; 
    267267                $.each(data, function(index, value) { 
    268268                        if(typeof value == 'object'){ 
    269269                                hasLabel = false; 
     270                                labelId = value.id; 
    270271                        }else{ 
    271272                                hasLabel = value; 
    272273                        } 
    273274                }); 
     275         
    274276                if(!hasLabel){ 
    275                         labels = DataLayer.get('label',{criteria:{order: 'id'}}, true); 
    276277                        newLabel = { 
    277                                 id: labels[labels.length - 1].id,  
    278                                 name : labels[labels.length- 1].name, 
     278                                id: labelId,  
     279                                name : nameLabel.trim(), 
    279280                                uid: User.me.id, 
    280281                                bgColor : !!isNew ? '#ebebeb' : winElement.find("input[name='backgroundColor']").val(), 
    281282                                fontColor : !!isNew ? '#000000' : winElement.find("input[name='fontColor']").val(), 
    282283                                borderColor : !!isNew ? '#000000' : winElement.find("input[name='borderColor']").val() 
    283                                  
    284284                        }; 
    285285                 
Note: See TracChangeset for help on using the changeset viewer.