Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Resources/Public/JavaScript/PageView/PageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ var dlfViewer = function (settings) {

/**
*
* @param {string | undefined}
* @param {string | undefined} progressElementId
* @returns {LoadingIndicator}
*/
dlfViewer.prototype.makeLoadingIndicator = function (progressElementId) {
Expand Down Expand Up @@ -749,6 +749,8 @@ dlfViewer.prototype.searchFeatures = function(stringFeatures, value) {

/**
* Displays highlight words
*
* @param {string} highlightWords
*/
dlfViewer.prototype.displayHighlightWord = function(highlightWords = null) {
if(highlightWords != null) {
Expand Down
11 changes: 6 additions & 5 deletions Resources/Public/JavaScript/PageView/SearchInDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
* Get navigation buttons.
*
* @param {int} start
* @param {numFound} start
* @param {int} numFound
*
* @returns {string}
*/
Expand Down Expand Up @@ -174,10 +174,11 @@
* Add highlight to image.
*
* @param {array} data
* @param {string} word

Check notice on line 177 in Resources/Public/JavaScript/PageView/SearchInDocument.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Resources/Public/JavaScript/PageView/SearchInDocument.js#L177

Intra-group tags have unexpected whitespace
*
* @returns void
*/
function addImageHighlight(data) {
function addImageHighlight(data, word) {
var page = getCurrentPage();

if (typeof tx_dlf_viewer !== 'undefined' && tx_dlf_viewer.map != null) { // eslint-disable-line camelcase
Expand All @@ -192,9 +193,9 @@
}
});

tx_dlf_viewer.displayHighlightWord(encodeURIComponent(highlights.join(';'))); // eslint-disable-line camelcase
tx_dlf_viewer.displayHighlightWord(word); // eslint-disable-line camelcase

Check warning on line 196 in Resources/Public/JavaScript/PageView/SearchInDocument.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Resources/Public/JavaScript/PageView/SearchInDocument.js#L196

'tx_dlf_viewer' is not defined.
} else {
setTimeout(addImageHighlight, 500, data);
setTimeout(addImageHighlight, 500, data, word);
}
}

Expand Down Expand Up @@ -263,7 +264,7 @@
resultList += '<li>' + item + '</li>';
});

addImageHighlight(data);
addImageHighlight(data, $( "input[id='tx-dlf-search-in-document-query']" ).val());
} else {
resultList += '<li class="noresult"></li>';
}
Expand Down
Loading