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