rem: if (isSelected) 
add: var saveMenu = document.getElementById('context-saveAttachment'); if (selectedAttachments.length > 0) 
context: function onShowAttachmentContextMenu(){  var attachmentList = document.getElementById('attachmentList');  var selectedAttachments = attachmentList.selectedItems;  var isSelected = (selectedAttachments.length > 0);  // if no attachments are selected you can't open an attachment  var openMenu = document.getElementById('context-openAttachment');  if (isSelected)  {    openMenu.removeAttribute('disabled');  }  else  {    openMenu.setAttribute('disabled', true);  }  // determine if all *selected* attachments are deleted    var isAllDeleted = true;  for (index in selectedAttachments)  {    var listItem = selectedAttachments[index];    isAllDeleted = listItem.attachment['isDeleted']();  }  // if no attachments are selected, or all selected attachments are already   // deleted, you can't save, detach or delete an attachment  var saveMenu = document.getElementById('context-saveAttachment');  var detachMenu = document.getElementById('context-detachAttachment');  var deleteMenu = document.getElementById('context-deleteAttachment');  if ( isSelected && !isAllDeleted )  {    saveMenu.removeAttribute('disabled');    detachMenu.removeAttribute('disabled');    deleteMenu.removeAttribute('disabled');  }  else  {    saveMenu.setAttribute('disabled', true);    detachMenu.setAttribute('disabled', true);    deleteMenu.setAttribute('disabled', true);  }  // determine if *all* attachments are deleted    isAllDeleted = true;  for (index in currentAttachments)  {    var attachment = currentAttachments[index];    isAllDeleted = (attachment.contentType == 'text/x-moz-deleted');  }  // if all selected attachments are already deleted, you can't save, detach or  // delete any attachments  var saveAllMenu = document.getElementById('context-saveAllAttachments');  var detachAllMenu = document.getElementById('context-detachAllAttachments');  var deleteAllMenu = document.getElementById('context-deleteAllAttachments');  if ( !isAllDeleted )  {    saveAllMenu.removeAttribute('disabled');    detachAllMenu.removeAttribute('disabled');    deleteAllMenu.removeAttribute('disabled');  }  else  {    saveAllMenu.setAttribute('disabled', true);    detachAllMenu.setAttribute('disabled', true);    deleteAllMenu.setAttribute('disabled', true);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/1653b73c2bb770359805e1bd5f8979722274e7e1/msgHdrViewOverlay.js/buggy/mailnews/base/resources/content/msgHdrViewOverlay.js