Index: trunk/prototype/modules/mail/js/label.js
===================================================================
--- trunk/prototype/modules/mail/js/label.js	(revision 5625)
+++ trunk/prototype/modules/mail/js/label.js	(revision 5643)
@@ -17,5 +17,5 @@
 }
 
-function editLabel(){	
+function editLabel(data){	
 	var conteudoSpan = $(this).parent().find(".text-list").text();
 	var span = $(this).parent().find(".text-list");
@@ -32,5 +32,5 @@
 			$(span).html($(".label-list").find(".edit-value-list").val())
 			.parent().find('.edit').removeClass("hidden").parents("li").click(configureLabel).trigger("click");
-			save_editLabel(nameLabel, applyToSelectedMessages);
+			save_editLabel(nameLabel, data.applyToSelectedMessages);
 			
 		}else if( event.keyCode == 27){
@@ -434,17 +434,14 @@
 	$(".button-close-window .close-window").click(function(){
 		$(".label-configure-win").dialog("close");
+	});
+	
+	winElement.find(':input').change(function(event){
+		if (event.keyCode != '27' && event.keyCode != '13' && !$(event.target).is(".edit-value-list"))
+		winElement.find(".save-label").button("enable");
+	}).keydown(function(event){
+		if (event.keyCode != '27' && event.keyCode != '13' && !$(event.target).is(".edit-value-list"))
+		winElement.find(".save-label").button("enable");
 	});	
-			
-	$(".configure-label-content").find("input[type='text']").focus(function () {
-		$(this).keyup(function(){
-			var value = $(this).val();
-			if(value){
-				$(".save-label").button("enable");	
-			}else{
-				$(".save-label").button("disable");	
-			}
-		});
-	});	
-	
+
 	$(".input-nome").keyup(function () {
 				var value = $(this).val();
Index: trunk/prototype/modules/mail/templates/followupflag_configure.ejs
===================================================================
--- trunk/prototype/modules/mail/templates/followupflag_configure.ejs	(revision 5599)
+++ trunk/prototype/modules/mail/templates/followupflag_configure.ejs	(revision 5643)
@@ -7,5 +7,5 @@
 		if (followupflagged.alarmDeadline)
 			followupflagged.alarmDeadline = Date.parseExact(followupflagged.alarmDeadline, 'yyyy-MM-dd hh:mm:ss');
-			
+
 	} else if (data.messages.length > 1) {
 		var followupflagged = {
@@ -27,15 +27,15 @@
 				data.messages[i].followupflagged.followupflag.name : false;
 				
-			followupflagged.isDone = (followupflagged.isDone && data.messages[i].followupflagged.followupflag.isDone == data.messages[i-1].followupflagged.followupflag.isDone) ?
-				data.messages[i].followupflagged.followupflag.isDone : false;
+			followupflagged.isDone = (followupflagged.isDone && data.messages[i].followupflagged.isDone == data.messages[i-1].followupflagged.isDone) ?
+				data.messages[i].followupflagged.isDone : false;
 				
-			followupflagged.doneDeadline = (followupflagged.doneDeadline && data.messages[i].followupflagged.followupflag.doneDeadline == data.messages[i-1].followupflagged.followupflag.doneDeadline) ?
-				Date.parseExact(data.messages[i].followupflagged.followupflag.doneDeadline, 'yyyy-MM-dd hh:mm:ss') : false;
+			followupflagged.doneDeadline = (followupflagged.doneDeadline && data.messages[i].followupflagged.doneDeadline == data.messages[i-1].followupflagged.doneDeadline) ?
+				Date.parseExact(data.messages[i].followupflagged.doneDeadline, 'yyyy-MM-dd hh:mm:ss') : false;
 				
-			followupflagged.alarmDeadline = (followupflagged.alarmDeadline && data.messages[i].followupflagged.followupflag.alarmDeadline == data.messages[i-1].followupflagged.followupflag.alarmDeadline) ?
-				Date.parseExact(data.messages[i].followupflagged.followupflag.alarmDeadline, 'yyyy-MM-dd hh:mm:ss') : false;
+			followupflagged.alarmDeadline = (followupflagged.alarmDeadline && data.messages[i].followupflagged.alarmDeadline == data.messages[i-1].followupflagged.alarmDeadline) ?
+				Date.parseExact(data.messages[i].followupflagged.alarmDeadline, 'yyyy-MM-dd hh:mm:ss') : false;
 				
-			followupflagged.backgroundColor = (followupflagged.backgroundColor && data.messages[i].followupflagged.followupflag.backgroundColor == data.messages[i-1].followupflagged.followupflag.backgroundColor) ?
-				data.messages[i].followupflagged.followupflag.backgroundColor : false;
+			followupflagged.backgroundColor = (followupflagged.backgroundColor && data.messages[i].followupflagged.backgroundColor == data.messages[i-1].followupflagged.backgroundColor) ?
+				data.messages[i].followupflagged.backgroundColor : false;
 		}
 	}
@@ -49,6 +49,5 @@
 			<select name="name">
 				<% for(var i=0; i<data.followupflags.length; i++) {  %>
-					
-					<% var selected = (data.followupflags[i].id == followupflagged.followupflagId ) ? 'selected="selected"' : '' %> 
+					<% var selected = (data.followupflags[i].name == followupflagged.followupflag.name  ) ? 'selected="selected"' : '' %> 
 					<option value="<%= data.followupflags[i].id %>" <%= selected %>><%= data.followupflags[i].name %></option>
 				<% } %>
