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:
Tim van der Meij 2016-02-26 22:37:51 +01:00
commit 0c19d84911

View File

@ -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) {