зеркало из https://github.com/mozilla/pjs.git
#46519 - composer edit mode tab stuff, r=hangas, a=ben
This commit is contained in:
Родитель
384110bc3c
Коммит
7d7c8f426a
|
@ -159,6 +159,9 @@ function EditorStartup(editorType, editorElement)
|
||||||
gSourceModeButton = document.getElementById("SourceModeButton");
|
gSourceModeButton = document.getElementById("SourceModeButton");
|
||||||
gPreviewModeButton = document.getElementById("PreviewModeButton");
|
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
|
// XUL elements we use when switching from normal editor to edit source
|
||||||
gContentWindowDeck = document.getElementById("ContentWindowDeck");
|
gContentWindowDeck = document.getElementById("ContentWindowDeck");
|
||||||
gFormatToolbar = document.getElementById("FormatToolbar");
|
gFormatToolbar = document.getElementById("FormatToolbar");
|
||||||
|
@ -995,10 +998,14 @@ function SetDisplayMode(mode)
|
||||||
editorShell.SetDisplayMode(mode);
|
editorShell.SetDisplayMode(mode);
|
||||||
|
|
||||||
// Set the UI states
|
// Set the UI states
|
||||||
gPreviewModeButton.setAttribute("selected",Number(mode == DisplayModePreview));
|
var selectedTab = null;
|
||||||
gNormalModeButton.setAttribute("selected",Number(mode == DisplayModeNormal));
|
if (mode == DisplayModePreview) selectedTab = gPreviewModeButton;
|
||||||
gTagModeButton.setAttribute("selected",Number(mode == DisplayModeAllTags));
|
if (mode == DisplayModeNormal) selectedTab = gNormalModeButton;
|
||||||
gSourceModeButton.setAttribute("selected", Number(mode == DisplayModeSource));
|
if (mode == DisplayModeAllTags) selectedTab = gTagModeButton;
|
||||||
|
if (mode == DisplayModeSource) selectedTab = gSourceModeButton;
|
||||||
|
if (selectedTab) {
|
||||||
|
document.getElementById("EditModeTabbox").selectedTab = selectedTab;
|
||||||
|
}
|
||||||
|
|
||||||
if (mode == DisplayModeSource)
|
if (mode == DisplayModeSource)
|
||||||
{
|
{
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
</deck>
|
</deck>
|
||||||
|
|
||||||
<toolbar id="EditModeToolbar" hidden="true" autostretch="never" valign="middle" persist="hidden collapsed">
|
<toolbar id="EditModeToolbar" hidden="true" autostretch="never" valign="middle" persist="hidden collapsed">
|
||||||
<tabbox class="tabbox-bottom" orient="horizontal" flex="1">
|
<tabbox id="EditModeTabbox" class="tabbox-bottom" orient="horizontal" flex="1">
|
||||||
<tab id="NormalModeButton"/>
|
<tab id="NormalModeButton"/>
|
||||||
<tab id="TagModeButton"/>
|
<tab id="TagModeButton"/>
|
||||||
<tab id="SourceModeButton"/>
|
<tab id="SourceModeButton"/>
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
skins/classic.jar:
|
||||||
|
editor/skin/EditModeTabs.css (EditModeTabs.css)
|
Загрузка…
Ссылка в новой задаче