Lifting up this.xref; buttons tooltips

This commit is contained in:
notmasteryet 2011-08-22 18:55:49 -05:00
parent 94eac2466e
commit d664652b86
2 changed files with 8 additions and 7 deletions

7
pdf.js
View File

@ -3438,9 +3438,10 @@ var Catalog = (function() {
return str; return str;
} }
var obj = this.catDict.get('Outlines'); var obj = this.catDict.get('Outlines');
var xref = this.xref;
var root = { items: [] }; var root = { items: [] };
if (IsRef(obj)) { if (IsRef(obj)) {
obj = this.xref.fetch(obj).get('First'); obj = xref.fetch(obj).get('First');
var processed = new RefSet(); var processed = new RefSet();
if (IsRef(obj)) { if (IsRef(obj)) {
var queue = [{obj: obj, parent: root}]; var queue = [{obj: obj, parent: root}];
@ -3449,12 +3450,12 @@ var Catalog = (function() {
processed.put(obj); processed.put(obj);
while (queue.length > 0) { while (queue.length > 0) {
var i = queue.shift(); var i = queue.shift();
var outlineDict = this.xref.fetch(i.obj); var outlineDict = xref.fetch(i.obj);
if (!outlineDict.has('Title')) if (!outlineDict.has('Title'))
error('Invalid outline item'); error('Invalid outline item');
var dest = outlineDict.get('A'); var dest = outlineDict.get('A');
if (dest) if (dest)
dest = this.xref.fetchIfRef(dest).get('D'); dest = xref.fetchIfRef(dest).get('D');
else if (outlineDict.has('Dest')) { else if (outlineDict.has('Dest')) {
dest = outlineDict.get('Dest'); dest = outlineDict.get('Dest');
if (IsName(dest)) if (IsName(dest))

View File

@ -60,11 +60,11 @@
<div id="outlineView"></div> <div id="outlineView"></div>
</div> </div>
<div id="sidebarControls"> <div id="sidebarControls">
<button id="thumbsSwitch" onclick="PDFView.switchSidebarView('thumbs')" data-selected> <button id="thumbsSwitch" title="Show Thumbnails" onclick="PDFView.switchSidebarView('thumbs')" data-selected>
<img src="images/nav-thumbs.svg" align="top" height="32" /> <img src="images/nav-thumbs.svg" align="top" height="32" alt="Thumbs" />
</button> </button>
<button id="outlineSwitch" onclick="PDFView.switchSidebarView('outline')" disabled> <button id="outlineSwitch" title="Show Document Outline" onclick="PDFView.switchSidebarView('outline')" disabled>
<img src="images/nav-outline.svg" align="top" height="32" /> <img src="images/nav-outline.svg" align="top" height="32" alt="Document Outline" />
</button> </button>
</div> </div>
</div> </div>