Merge pull request #6943 from Snuffleupagus/outline-styles
Add support for bold/italic styled outline items in the viewer
This commit is contained in:
commit
d302ac612e
@ -82,6 +82,23 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_setStyles: function PDFOutlineView_setStyles(element, item) {
|
||||||
|
var styleStr = '';
|
||||||
|
if (item.bold) {
|
||||||
|
styleStr += 'font-weight: bold;';
|
||||||
|
}
|
||||||
|
if (item.italic) {
|
||||||
|
styleStr += 'font-style: italic;';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (styleStr) {
|
||||||
|
element.setAttribute('style', styleStr);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepend a button before an outline item which allows the user to toggle
|
* Prepend a button before an outline item which allows the user to toggle
|
||||||
* the visibility of all outline items at that level.
|
* the visibility of all outline items at that level.
|
||||||
@ -161,6 +178,7 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
|
|||||||
|
|
||||||
var element = document.createElement('a');
|
var element = document.createElement('a');
|
||||||
this._bindLink(element, item);
|
this._bindLink(element, item);
|
||||||
|
this._setStyles(element, item);
|
||||||
element.textContent =
|
element.textContent =
|
||||||
PDFJS.removeNullCharacters(item.title) || DEFAULT_TITLE;
|
PDFJS.removeNullCharacters(item.title) || DEFAULT_TITLE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user