Don't disable outline. Add some more style to outline.
This commit is contained in:
parent
3d43576838
commit
88ffc2db33
@ -530,10 +530,10 @@ body {
|
||||
|
||||
#outlineView {
|
||||
position: fixed;
|
||||
width: 188px;
|
||||
width: 192px;
|
||||
top: 33px;
|
||||
bottom: 0;
|
||||
padding: 16px 4px 0;
|
||||
padding: 4px 4px 0;
|
||||
overflow: auto;
|
||||
-moz-user-select:none;
|
||||
-webkit-user-select:none;
|
||||
@ -542,8 +542,13 @@ body {
|
||||
display:none;
|
||||
}
|
||||
|
||||
/*.outlineItem {
|
||||
width: -moz-calc(100% - 8px);
|
||||
.outlineItem > .outlineItems {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.outlineItem > a {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
height: 20px;
|
||||
padding: 2px 0 0 10px;
|
||||
margin-bottom: 1px;
|
||||
@ -553,9 +558,10 @@ body {
|
||||
line-height: 15px;
|
||||
-moz-user-select:none;
|
||||
cursor: default;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.outlineItem:hover {
|
||||
.outlineItem > a:hover {
|
||||
background-color: hsla(0,0%,100%,.02);
|
||||
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
|
||||
background-clip: padding-box;
|
||||
@ -574,22 +580,11 @@ body {
|
||||
0 0 1px hsla(0,0%,0%,.2);
|
||||
color: hsla(0,0%,100%,1);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
.outlineItem > .outlineItems {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.outlineItem > a {
|
||||
text-decoration: none;
|
||||
color: hsla(0,0%,100%,.8);
|
||||
.noOutline {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.outlineItem > a:hover {
|
||||
background-color: hsla(0,0%,100%,.1);
|
||||
color: hsla(0,0%,100%,.9);
|
||||
color: hsla(0,0%,100%,.8);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
<div id="toolbarSidebar">
|
||||
<div class="splitToolbarButton toggled">
|
||||
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" onclick="PDFView.switchSidebarView('thumbs')"></button>
|
||||
<button id="viewOutline" class="toolbarButton" title="Show Document Outline" onclick="PDFView.switchSidebarView('outline')" disabled></button>
|
||||
<button id="viewOutline" class="toolbarButton" title="Show Document Outline" onclick="PDFView.switchSidebarView('outline')"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebarContent">
|
||||
|
@ -557,13 +557,7 @@ var PDFView = {
|
||||
// outline and initial view depends on destinations and pagesRefMap
|
||||
PDFJS.Promise.all([pagesPromise, destinationsPromise]).then(function() {
|
||||
pdfDocument.getOutline().then(function(outline) {
|
||||
if (!outline)
|
||||
return;
|
||||
|
||||
self.outline = new DocumentOutlineView(outline);
|
||||
var outlineSwitchButton = document.getElementById('viewOutline');
|
||||
outlineSwitchButton.removeAttribute('disabled');
|
||||
self.switchSidebarView('outline');
|
||||
});
|
||||
|
||||
self.setInitialView(storedHash, scale);
|
||||
@ -1149,6 +1143,14 @@ var DocumentOutlineView = function documentOutlineView(outline) {
|
||||
};
|
||||
}
|
||||
|
||||
if (!outline) {
|
||||
var noOutline = document.createElement('div');
|
||||
noOutline.classList.add('noOutline');
|
||||
noOutline.textContent = 'No Outline Available';
|
||||
outlineView.appendChild(noOutline);
|
||||
return;
|
||||
}
|
||||
|
||||
var queue = [{parent: outlineView, items: outline}];
|
||||
while (queue.length > 0) {
|
||||
var levelData = queue.shift();
|
||||
|
Loading…
Reference in New Issue
Block a user