Changeset 5547 for trunk/prototype/modules/mail/js/label.js
- Timestamp:
- 02/24/12 15:09:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/mail/js/label.js
r5537 r5547 1 function configureLabel(event, ui){ 2 var idmarkernow = $(this).find('[name="labelItemId"]').val(); 3 winElement.find('.edit-label').val(idmarkernow); 4 winElement.find('.input-nome').val($(this).find("span").text()); 5 6 var colorpicker = winElement.find('.lebals-colorpicker'); 7 colorpicker.find('input[name="backgroundColor"]').val(rgb2hex($(this).css("backgroundColor"))) 8 .css("background-color", $(this).css("backgroundColor")).focus().end() 9 .find('input[name="fontColor"]').val(rgb2hex($(this).css("color"))).css("background-color", $(this).css("color")).focus().end() 10 .find('input[name="borderColor"]').val(rgb2hex($(this).css("border-left-color"))).css("background-color", $(this).css("border-left-color")).focus().end() 11 .find('.preview-label-outer').css({ 12 'background-color':$(this).css("backgroundColor"), 13 'color':$(this).css("color"), 14 'border-color':$(this).css("border-left-color") 15 }) 16 winElement.find(".preview-label-inner").text($(this).text()); 17 } 1 18 function editLabel(){ 2 19 var conteudoSpan = $(this).parent().find(".text-list").text(); … … 43 60 ("0" + parseInt(rgb[3],10).toString(16)).slice(-2); 44 61 } 45 function configureLabel(event, ui){ 46 var idmarkernow = $(this).find('[name="labelItemId"]').val(); 47 winElement.find('.edit-label').val(idmarkernow); 48 winElement.find('.input-nome').val($(this).find("span").text()); 49 50 var colorpicker = winElement.find('.lebals-colorpicker'); 51 colorpicker.find('input[name="backgroundColor"]').val(rgb2hex($(this).css("backgroundColor"))) 52 .css("background-color", $(this).css("backgroundColor")).focus().end() 53 .find('input[name="fontColor"]').val(rgb2hex($(this).css("color"))).css("background-color", $(this).css("color")).focus().end() 54 .find('input[name="borderColor"]').val(rgb2hex($(this).css("border-left-color"))).css("background-color", $(this).css("border-left-color")).focus().end() 55 .find('.preview-label-outer').css({ 56 'background-color':$(this).css("backgroundColor"), 57 'color':$(this).css("color"), 58 'border-color':$(this).css("border-left-color") 59 }) 60 winElement.find(".preview-label-inner").text($(this).text()); 61 } 62 62 63 function confirmDelete(id){ 63 64 $.Zebra_Dialog('<strong>Deseja excluir esse marcador?</strong>', { … … 112 113 } 113 114 } 114 function new_label(nameLabel ){115 function new_label(nameLabel, isNew){ 115 116 var labelCreated = { 116 117 uid: User.me.id, 117 118 name : nameLabel, 118 backgroundColor : winElement.find("input[name='backgroundColor']").val(),119 fontColor : winElement.find("input[name='fontColor']").val(),120 borderColor : winElement.find("input[name='borderColor']").val()119 backgroundColor : !!isNew ? '#ebebeb' : winElement.find("input[name='backgroundColor']").val(), 120 fontColor : !!isNew ? '#000000' : winElement.find("input[name='fontColor']").val(), 121 borderColor :!!isNew ? '#000000' : winElement.find("input[name='borderColor']").val() 121 122 } 122 123 DataLayer.put('label', labelCreated); … … 132 133 name : labels[labels.length- 1].name, 133 134 uid: User.me.id, 134 bgColor : winElement.find("input[name='backgroundColor']").val(),135 fontColor : winElement.find("input[name='fontColor']").val(),136 borderColor : winElement.find("input[name='borderColor']").val()135 bgColor : !!isNew ? '#ebebeb' : winElement.find("input[name='backgroundColor']").val(), 136 fontColor : !!isNew ? '#000000' : winElement.find("input[name='fontColor']").val(), 137 borderColor : !!isNew ? '#000000' : winElement.find("input[name='borderColor']").val() 137 138 }; 138 139 … … 197 198 198 199 winElement = data.window; 199 200 /* var configureLabel = function(event, ui){ 201 var idmarkernow = $(this).find('[name="labelItemId"]').val(); 202 winElement.find('.edit-label').val(idmarkernow); 203 winElement.find('.input-nome').val($(this).find("span").text()); 204 205 var colorpicker = winElement.find('.lebals-colorpicker'); 206 colorpicker.find('input[name="backgroundColor"]').val(rgb2hex($(this).css("backgroundColor"))) 207 .css("background-color", $(this).css("backgroundColor")).focus().end() 208 .find('input[name="fontColor"]').val(rgb2hex($(this).css("color"))).css("background-color", $(this).css("color")).focus().end() 209 .find('input[name="borderColor"]').val(rgb2hex($(this).css("border-left-color"))).css("background-color", $(this).css("border-left-color")).focus().end() 210 .find('.preview-label-outer').css({ 211 'background-color':$(this).css("backgroundColor"), 212 'color':$(this).css("color"), 213 'border-color':$(this).css("border-left-color") 214 }) 215 winElement.find(".preview-label-inner").text($(this).text()); 216 } */ 200 217 201 //TODO Mudar quando API abstrair atualizações no cache 218 202 DataLayer.remove('label',false); … … 320 304 var nameLabel = winElement.find(".insert-label").val(); 321 305 if(nameLabel.length >= 2){ 322 new_label(nameLabel );306 new_label(nameLabel, true); 323 307 $.Watermark.ShowAll(); 324 308 winElement.find(".insert-label").val(""); … … 421 405 var nameLabel = winElement.find(".input-nome").val(); 422 406 if(nameLabel.length >= 2){ 423 new_label(nameLabel );407 new_label(nameLabel, false); 424 408 winElement.find(".insert-label").val(""); 425 409 $.Watermark.ShowAll();
Note: See TracChangeset
for help on using the changeset viewer.