From 9cba9712addb2c99e2b626aa1be68039ab9ef6ab Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Mon, 1 May 2006 18:20:03 +0000 Subject: [PATCH] fix 236219 Unreliable highlighting in compose window when tabbing thru, patch by mcow@well.com, r=bienvenu, sr=mscott git-svn-id: svn://10.0.0.236/trunk@195765 18797224-902f-48f8-a5cc-f745e15eee43 --- .../compose/content/MsgComposeCommands.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mozilla/mail/components/compose/content/MsgComposeCommands.js b/mozilla/mail/components/compose/content/MsgComposeCommands.js index 6990b7d34b6..19683e505f4 100644 --- a/mozilla/mail/components/compose/content/MsgComposeCommands.js +++ b/mozilla/mail/components/compose/content/MsgComposeCommands.js @@ -1725,7 +1725,7 @@ function GenericSendMessage( msgType ) { // We disable spellcheck for the following -subject line, attachment pane, identity and addressing widget // therefore we need to explicitly focus on the mail body when we have to do a spellcheck. - window.content.focus(); + SetMsgBodyFrameFocus(); window.cancelSendMessage = false; try { window.openDialog("chrome://editor/content/EdSpellCheck.xul", "_blank", @@ -2403,7 +2403,7 @@ function getIdentityForKey(key) function AdjustFocus() { //dump("XXX adjusting focus\n"); - var element = document.getElementById("addressCol2#" + awGetNumberOfRecipients()); + var element = awGetInputElement(awGetNumberOfRecipients()); if (element.value == "") { //dump("XXX focus on address\n"); awSetFocus(awGetNumberOfRecipients(), element); @@ -2417,7 +2417,7 @@ function AdjustFocus() } else { //dump("XXX focus on body\n"); - window.content.focus(); + SetMsgBodyFrameFocus(); } } } @@ -2779,7 +2779,7 @@ function FocusOnFirstAttachment() var bucketList = document.getElementById("attachmentBucket"); if (bucketList && bucketList.getRowCount()) - bucketTree.selectedIndex(0); + bucketList.selectedIndex = 0; } function AttachmentElementHasItems() @@ -3140,12 +3140,12 @@ function subjectKeyPress(event) switch(event.keyCode) { case 9: if (!event.shiftKey) { - window.content.focus(); + SetMsgBodyFrameFocus(); event.preventDefault(); } break; case 13: - window.content.focus(); + SetMsgBodyFrameFocus(); break; } } @@ -3318,7 +3318,7 @@ function DisplaySaveFolderDlg(folderURI) function SetMsgAddressingWidgetTreeElementFocus() { - var element = document.getElementById("msgRecipient#" + awGetNumberOfRecipients()); + var element = awGetInputElement(awGetNumberOfRecipients()); awSetFocus(awGetNumberOfRecipients(), element); } @@ -3340,7 +3340,10 @@ function SetMsgAttachmentElementFocus() function SetMsgBodyFrameFocus() { - window.content.focus(); + // bug 236219: never just set the focus to window.content, that fails to perform + // the 'unfocus' operation on the element that currently has focus. + document.getElementById("appcontent").focus(); // focus to editor's container + window.content.focus(); // focus to editor } function GetMsgAddressingWidgetTreeElement()