Changeset 5623


Ignore:
Timestamp:
03/05/12 10:22:22 (12 years ago)
Author:
thiago
Message:

Ticket #2486 - Melhoria no codigo da revisão: 5612

Location:
trunk
Files:
2 edited

Legend:

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

    r5620 r5623  
    343343        else 
    344344                var myLabels = $("#MyMarckersList"); 
    345                  
    346345        myLabels.html("<div class='my-labels'>" + 
    347346                                "<img src='../prototype/modules/mail/img/tag.png'/>" + 
     
    353352        .append(DataLayer.render("../prototype/modules/mail/templates/label_list.ejs", {labels: labels} )) 
    354353        .find("li.label-item").css({"background-color":"#ffffff", "border-color":"#CCCCCC", "color":"#444444"}).click(function(event,ui){ 
    355                 if($(event.target).is('.square-color') == false){ 
    356                         var labelId = $(this).attr('class').match(/label-item-([\d]+[()a-zA-Z]*)/)[1]; 
    357                         search_emails("UNDELETED KEYWORD \"$Label"+labelId+"\""); 
    358                 } 
    359         }).end() 
    360         .find(".square-color").css("display","").click(function(){ 
    361                 $(this).parent(".label-item").each(function(){ 
    362                         configureLabels({selectedItem: $(this).attr('class').match(/label-item-([\d]+[()a-zA-Z]*)/)[1]}); 
    363                         var id_label_item = $(this).attr('class').match(/label-item-([\d]+[()a-zA-Z]*)/)[1]; 
    364                         $(".label-list-container .label-list").find(".label-item-"+id_label_item).trigger("click"); 
    365                 }); 
     354                if($(event.target).is('.square-color')){ 
     355                                $(this).each(function(){ 
     356                                        configureLabels({selectedItem: $(this).attr('class').match(/label-item-([\d]+[()a-zA-Z]*)/)[1]}); 
     357                                        var id_label_item = $(this).attr('class').match(/label-item-([\d]+[()a-zA-Z]*)/)[1]; 
     358                                        $(".label-list-container .label-list").find(".label-item-"+id_label_item).trigger("click"); 
     359                                }); 
     360                } else { 
     361                                var labelId = $(this).attr('class').match(/label-item-([\d]+[()a-zA-Z]*)/)[1]; 
     362                                search_emails("UNDELETED KEYWORD \"$Label"+labelId+"\""); 
     363                } 
    366364        }); 
    367365         
  • trunk/prototype/modules/mail/templates/label_list.ejs

    r5537 r5623  
    1111                                <input type="hidden" value="<%= data.labels[i].id%>" name="labelItemId" class="id-item-list" /> 
    1212                                 
    13                                 <div class="square-color" style="display:none;width:17px;height:12px;margin-top:1px;-moz-border-radius:3px;-webkit-border-radius:3px; 
     13                                <div class="square-color" style="width:17px;height:12px;margin-top:1px;-moz-border-radius:3px;-webkit-border-radius:3px; 
    1414                                                background: <%= (data.labels[i].backgroundColor) ? data.labels[i].backgroundColor : '#ffffff' %>; float:right;"></div> 
    1515 
Note: See TracChangeset for help on using the changeset viewer.