Fixed JS warnings and window title bugs 57649, 73807; r=brade, hurricane; sr=sfraser

This commit is contained in:
cmanske%netscape.com 2001-04-04 21:52:25 +00:00
Родитель 8671647202
Коммит 0f51b8f6fb
1 изменённых файлов: 11 добавлений и 2 удалений

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

@ -541,7 +541,7 @@ function onParagraphFormatChange(paraMenuList, commandID)
for (var i=0; i < menuItems.length; i++)
{
var menuItem = menuItems.item(i);
if (menuItem.value == state)
if ("value" in menuItem && menuItem.value == state)
{
paraMenuList.selectedItem = menuItem;
break;
@ -577,7 +577,7 @@ function onFontFaceChange(fontFaceMenuList, commandID)
for (var i=0; i < menuItems.length; i++)
{
var menuItem = menuItems.item(i);
if (menuItem.getAttribute("label") && (menuItem.value.toLowerCase() == state.toLowerCase()))
if (menuItem.getAttribute("label") && ("value" in menuItem && menuItem.value.toLowerCase() == state.toLowerCase()))
{
fontFaceMenuList.selectedItem = menuItem;
break;
@ -1128,14 +1128,23 @@ function SetEditMode(mode)
window._content.focus();
}
ResetWindowTitleWithFilename();
}
}
function ResetWindowTitleWithFilename()
{
// Calling this resets the "Title [filename]" that we show on window caption
window.editorShell.SetDocumentTitle(window.editorShell.GetDocumentTitle());
}
function CancelHTMLSource()
{
// Don't convert source text back into the DOM document
gSourceContentWindow.value = "";
SetDisplayMode(PreviousNonSourceDisplayMode);
ResetWindowTitleWithFilename();
}