fix annotation export for books without author

This commit is contained in:
j 2019-02-14 18:07:08 +05:30
parent 255de5664d
commit 6f8acb90d9
1 changed files with 4 additions and 1 deletions

View File

@ -45,7 +45,10 @@ oml.ui.exportAnnotationsDialog = function(data) {
function getAnnotationsText() {
var annotations = oml.$ui.viewer.getAnnotations()
var text = 'Annotations for ' + data.title + ' (' + data.author.join(', ') + ')\n\n\n\n'
var text = 'Annotations for ' + data.title + (
data.author ?' (' + data.author.join(', ') + ')'
: ''
) + '\n\n\n\n'
text += annotations.map(function(annotation) {
var page = annotation.pageLabel || annotation.page
var text = 'Quote' + (page ? ' Page ' + page : '' )+ ':\n\n' + annotation.text