Merge pull request #7031 from Snuffleupagus/outline-default-title
Add a default title for outline items, to prevent display issues if the title is missing
This commit is contained in:
commit
0c19d84911
@ -16,6 +16,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var DEFAULT_TITLE = '\u2013';
|
||||
|
||||
/**
|
||||
* @typedef {Object} PDFOutlineViewOptions
|
||||
* @property {HTMLDivElement} container - The viewer element.
|
||||
@ -137,11 +139,15 @@ var PDFOutlineView = (function PDFOutlineViewClosure() {
|
||||
var levelData = queue.shift();
|
||||
for (var i = 0, len = levelData.items.length; i < len; i++) {
|
||||
var item = levelData.items[i];
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.className = 'outlineItem';
|
||||
|
||||
var element = document.createElement('a');
|
||||
this._bindLink(element, item);
|
||||
element.textContent = PDFJS.removeNullCharacters(item.title);
|
||||
element.textContent =
|
||||
PDFJS.removeNullCharacters(item.title) || DEFAULT_TITLE;
|
||||
|
||||
div.appendChild(element);
|
||||
|
||||
if (item.items.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user