Workaround for focus appearance issues b=236219 r=Mnyromyr (patch based on original work by Mike Cowperthwaite and Wayne Woods r=bienvenu sr=mscott)

This commit is contained in:
neil%parkwaycc.co.uk 2007-02-13 00:19:13 +00:00
Родитель f510b2b0f1
Коммит e6eca25b93
1 изменённых файлов: 8 добавлений и 9 удалений

Просмотреть файл

@ -273,9 +273,6 @@ var gComposeRecyclingListener = {
onReopen: function(params) {
// Reset focus to avoid undesirable visual effect when reopening the window
var identityElement = document.getElementById("msgIdentity");
if (identityElement)
identityElement.focus();
InitializeGlobalVariables();
ComposeStartup(true, params);
@ -1700,7 +1697,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",
@ -2362,7 +2359,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);
@ -2376,7 +2373,7 @@ function AdjustFocus()
}
else {
//dump("XXX focus on body\n");
window.content.focus();
SetMsgBodyFrameFocus();
}
}
}
@ -2954,12 +2951,12 @@ function subjectKeyPress(event)
switch(event.keyCode) {
case 9:
if (!event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey) {
window.content.focus();
SetMsgBodyFrameFocus();
event.preventDefault();
}
break;
case 13:
window.content.focus();
SetMsgBodyFrameFocus();
break;
}
}
@ -3134,7 +3131,9 @@ function SetMsgAttachmentElementFocus()
function SetMsgBodyFrameFocus()
{
window.content.focus();
//window.content.focus(); fails to blur the currently focused element
document.commandDispatcher
.advanceFocusIntoSubtree(document.getElementById("appcontent"));
}
function GetMsgAddressingWidgetElement()