Skip to content
Snippets Groups Projects
Commit 09a72fa2 authored by Iain Bryson's avatar Iain Bryson
Browse files

Enable sidebar with Document Outline by default. Fixes #1

parent 0ab470e1
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ var PDFSidebar = (function PDFSidebarClosure() {
*/
function PDFSidebar(options) {
this.isOpen = false;
this.active = SidebarView.THUMBS;
this.active = SidebarView.OUTLINE;
this.isInitialViewSet = false;
/**
......@@ -105,9 +105,9 @@ var PDFSidebar = (function PDFSidebarClosure() {
this.isInitialViewSet = false;
this.close();
this.switchView(SidebarView.THUMBS);
this.switchView(SidebarView.OUTLINE);
this.outlineButton.disabled = false;
this.thumbnailButton.disabled = false;
this.attachmentsButton.disabled = false;
},
......@@ -140,6 +140,8 @@ var PDFSidebar = (function PDFSidebarClosure() {
}
this.isInitialViewSet = true;
console.log('setInitialView: ' + view + " " + this.active);
if (this.isOpen && view === SidebarView.NONE) {
this._dispatchEvent();
// If the user has already manually opened the sidebar,
......@@ -169,6 +171,7 @@ var PDFSidebar = (function PDFSidebarClosure() {
}
var isViewChanged = (view !== this.active);
var shouldForceRendering = false;
console.log("SwitchView " + view + " from "+ this.active);
switch (view) {
case SidebarView.THUMBS:
......@@ -217,6 +220,7 @@ var PDFSidebar = (function PDFSidebarClosure() {
// Update the active view *after* it has been validated above,
// in order to prevent setting it to an invalid state.
this.active = view | 0;
console.log("SwitchView updated to " + this.active);
if (forceOpen && !this.isOpen) {
this.open();
......@@ -266,6 +270,7 @@ var PDFSidebar = (function PDFSidebarClosure() {
if (this.isOpen) {
this.close();
} else {
console.log("Sidebar toggle open "+ this.active);
this.open();
}
},
......
......@@ -78,10 +78,10 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="sidebarContainer">
<div id="toolbarSidebar">
<div class="splitToolbarButton toggled">
<button id="viewThumbnail" class="toolbarButton group toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
<button id="viewThumbnail" class="toolbarButton group" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
<span data-l10n-id="thumbs_label">Thumbnails</span>
</button>
<button id="viewOutline" class="toolbarButton group" title="Show Document Outline" tabindex="3" data-l10n-id="outline">
<button id="viewOutline" class="toolbarButton group toggled" title="Show Document Outline" tabindex="3" data-l10n-id="outline">
<span data-l10n-id="outline_label">Document Outline</span>
</button>
<button id="viewAttachments" class="toolbarButton group" title="Show Attachments" tabindex="4" data-l10n-id="attachments">
......@@ -90,9 +90,9 @@ See https://github.com/adobe-type-tools/cmap-resources
</div>
</div>
<div id="sidebarContent">
<div id="thumbnailView">
<div id="thumbnailView" class="hidden">
</div>
<div id="outlineView" class="hidden">
<div id="outlineView">
</div>
<div id="attachmentsView" class="hidden">
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment