Fixed command disabling/focus setting when loading page into new editor. b=181002, r=brade, sr=kin

This commit is contained in:
cmanske%netscape.com 2002-11-21 23:53:50 +00:00
Родитель b129f6ff18
Коммит 59bee1edc8
1 изменённых файлов: 10 добавлений и 10 удалений

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

@ -283,8 +283,10 @@ var gEditorDocumentObserver =
if (editorType != "htmlmail"
&& editorType != "textmail")
{
// Mail Composers start focus in address area
gContentWindow.focus();
// Set focus to content window if not a mail composer
// Race conditions prevent us from setting focus here
// when loading a url into blank window
setTimeout("SetFocusOnStartup()", 0);
}
if (!("InsertCharWindow" in window))
@ -311,10 +313,6 @@ var gEditorDocumentObserver =
controller.SetCommandRefCon(editor.QueryInterface(Components.interfaces.nsISupports));
} catch (e) {}
}
// udpate menu items now that we have an editor to play with
window.updateCommands("create");
// Call EditorSetDefaultPrefsAndDoctype first so it gets the default author before initing toolbars
EditorSetDefaultPrefsAndDoctype();
@ -356,10 +354,6 @@ var gEditorDocumentObserver =
item.hidden = true;
}
}
// Unfortunately, we have to redo all command enabling
// that were done before we changed to "text" editing
window.updateCommands("create");
}
// Set window title and build "Recent Files" menu
@ -403,6 +397,11 @@ var gEditorDocumentObserver =
}
}
function SetFocusOnStartup()
{
gContentWindow.focus();
}
function EditorStartup()
{
var is_HTMLEditor = IsHTMLEditor();
@ -3200,3 +3199,4 @@ function FillInHTMLTooltip(tooltip)
}
return false;
}