diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/components/compose/content/MsgComposeCommands.js index 8dcba3faae6..473db6020e0 100644 --- a/mail/components/compose/content/MsgComposeCommands.js +++ b/mail/components/compose/content/MsgComposeCommands.js @@ -53,7 +53,7 @@ var sNameProperty = null; in the other js file. */ var msgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"].createInstance(); - +msgWindow = msgWindow.QueryInterface(Components.interfaces.nsIMsgWindow); /** * Global variables, need to be re-initialized every time mostly because we need to release them when the window close @@ -1709,7 +1709,9 @@ function GenericSendMessage( msgType ) progress.registerListener(progressListener); gSendOrSaveOperationInProgress = true; } - gMsgCompose.SendMsg(msgType, getCurrentIdentity(), progress); + msgWindow.SetDOMWindow(window); + + gMsgCompose.SendMsg(msgType, getCurrentIdentity(), msgWindow, progress); } catch (ex) { dump("failed to SendMsg: " + ex + "\n"); @@ -1775,9 +1777,9 @@ function Save() function SaveAsFile(saveAs) { - dump("SaveAsFile from XUL\n"); - var subject = document.getElementById('msgSubject').value; - GetCurrentEditor().setDocumentTitle(subject); + dump("SaveAsFile from XUL\n"); + var subject = document.getElementById('msgSubject').value; + GetCurrentEditor().setDocumentTitle(subject); if (gMsgCompose.bodyConvertible() == nsIMsgCompConvertible.Plain) SaveDocument(saveAs, false, "text/plain"); @@ -2364,7 +2366,7 @@ function FocusOnFirstAttachment() function AttachmentElementHasItems() { - var element = document.getElementById("bucketList"); + var element = document.getElementById("attachmentBucket"); return element ? element.childNodes.length : 0; }