From 0f51b8f6fb3e852f0b7755ae680a6ce8b5651b42 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Wed, 4 Apr 2001 21:52:25 +0000 Subject: [PATCH] Fixed JS warnings and window title bugs 57649, 73807; r=brade, hurricane; sr=sfraser --- editor/ui/composer/content/editor.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/editor/ui/composer/content/editor.js b/editor/ui/composer/content/editor.js index e938eaa0453..c32bb3dd2cb 100644 --- a/editor/ui/composer/content/editor.js +++ b/editor/ui/composer/content/editor.js @@ -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(); }