diff --git a/mozilla/mail/components/compose/content/MsgComposeCommands.js b/mozilla/mail/components/compose/content/MsgComposeCommands.js index b688e6745fc..6990b7d34b6 100644 --- a/mozilla/mail/components/compose/content/MsgComposeCommands.js +++ b/mozilla/mail/components/compose/content/MsgComposeCommands.js @@ -215,11 +215,14 @@ var gComposeRecyclingListener = { awResetAllRows(); RemoveAllAttachments(); - // We need to clear the identity popup menu in case the user will change them. It will be rebuilded later in ComposeStartup + // We need to clear the identity popup menu in case the user will change them. + // It will be rebuilt later in ComposeStartup ClearIdentityListPopup(document.getElementById("msgIdentityPopup")); //Clear the subject - document.getElementById("msgSubject").value = ""; + GetMsgSubjectElement().value = ""; + // be sure to clear the transaction manager for the subject + GetMsgSubjectElement().editor.transactionManager.clear(); SetComposeWindowTitle(); SetContentAndBodyAsUnmodified(); @@ -1380,7 +1383,7 @@ function ComposeStartup(recycled, aParams) } var subjectValue = msgCompFields.subject; - document.getElementById("msgSubject").value = subjectValue; + GetMsgSubjectElement().value = subjectValue; var attachments = msgCompFields.attachmentsArray; if (attachments) @@ -1711,7 +1714,7 @@ function GenericSendMessage( msgType ) if (msgCompFields) { Recipients2CompFields(msgCompFields); - var subject = document.getElementById("msgSubject").value; + var subject = GetMsgSubjectElement().value; msgCompFields.subject = subject; Attachments2CompFields(msgCompFields); @@ -1748,7 +1751,7 @@ function GenericSendMessage( msgType ) {value:0})) { msgCompFields.subject = result.value; - var subjectInputElem = document.getElementById("msgSubject"); + var subjectInputElem = GetMsgSubjectElement(); subjectInputElem.value = result.value; } else @@ -1999,7 +2002,7 @@ function Save() function SaveAsFile(saveAs) { dump("SaveAsFile from XUL\n"); - var subject = document.getElementById('msgSubject').value; + var subject = GetMsgSubjectElement().value; GetCurrentEditor().setDocumentTitle(subject); if (gMsgCompose.bodyConvertible() == nsIMsgCompConvertible.Plain) @@ -2407,7 +2410,7 @@ function AdjustFocus() } else { - element = document.getElementById("msgSubject"); + element = GetMsgSubjectElement(); if (element.value == "") { //dump("XXX focus on subject\n"); element.focus(); @@ -2421,7 +2424,7 @@ function AdjustFocus() function SetComposeWindowTitle() { - var newTitle = document.getElementById('msgSubject').value; + var newTitle = GetMsgSubjectElement().value; /* dump("newTitle = " + newTitle + "\n"); */