Merge pull request #699 from dvoracek-slub/fix-highlight-word

Quick Fix: Wait for `tx_dlf_viewer` when highlighting word
This commit is contained in:
Alexander Bigga 2021-10-20 12:47:23 +02:00 committed by GitHub
commit f7f2f0f69d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -259,7 +259,7 @@ function addImageHighlight(data) {
data['documents'].forEach(function (element, i) {
if(element['page'] === page) {
if (element['highlight'].length > 0) {
if(tx_dlf_viewer.map != null) {
if (typeof tx_dlf_viewer !== 'undefined' && tx_dlf_viewer.map != null) { // eslint-disable-line camelcase
tx_dlf_viewer.displayHighlightWord(encodeURIComponent(getHighlights(element['highlight'])));
} else {
setTimeout(addImageHighlight, 500, data);