diff --git a/editor/ui/composer/content/editor.js b/editor/ui/composer/content/editor.js index 0658b6ae576..25df317d3a8 100644 --- a/editor/ui/composer/content/editor.js +++ b/editor/ui/composer/content/editor.js @@ -159,6 +159,9 @@ function EditorStartup(editorType, editorElement) gSourceModeButton = document.getElementById("SourceModeButton"); gPreviewModeButton = document.getElementById("PreviewModeButton"); + // mark first tab as selected + document.getElementById("EditModeTabbox").selectedTab = gNormalModeButton; + // XUL elements we use when switching from normal editor to edit source gContentWindowDeck = document.getElementById("ContentWindowDeck"); gFormatToolbar = document.getElementById("FormatToolbar"); @@ -995,10 +998,14 @@ function SetDisplayMode(mode) editorShell.SetDisplayMode(mode); // Set the UI states - gPreviewModeButton.setAttribute("selected",Number(mode == DisplayModePreview)); - gNormalModeButton.setAttribute("selected",Number(mode == DisplayModeNormal)); - gTagModeButton.setAttribute("selected",Number(mode == DisplayModeAllTags)); - gSourceModeButton.setAttribute("selected", Number(mode == DisplayModeSource)); + var selectedTab = null; + if (mode == DisplayModePreview) selectedTab = gPreviewModeButton; + if (mode == DisplayModeNormal) selectedTab = gNormalModeButton; + if (mode == DisplayModeAllTags) selectedTab = gTagModeButton; + if (mode == DisplayModeSource) selectedTab = gSourceModeButton; + if (selectedTab) { + document.getElementById("EditModeTabbox").selectedTab = selectedTab; + } if (mode == DisplayModeSource) { diff --git a/editor/ui/composer/content/editor.xul b/editor/ui/composer/content/editor.xul index 8441d2387b9..025adaabf9f 100644 --- a/editor/ui/composer/content/editor.xul +++ b/editor/ui/composer/content/editor.xul @@ -225,7 +225,7 @@