Skip to content

Commit

Permalink
[BUGFIX] Improve score loading condition in PageView.js (#1387)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
fschoelzel and sebastian-meyer authored Dec 16, 2024
1 parent 5de9efb commit 5161a46
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Resources/Public/JavaScript/PageView/PageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ dlfViewer.prototype.addCustomControls = function() {
$('#tx-dlf-tools-fulltext').remove();
}

if (this.scoresLoaded_ !== undefined) {
if (this.scoresLoaded_ !== undefined && this.scoresLoaded_ !== null) {
var context = this;
const scoreControl = new dlfViewerScoreControl(this, this.pagebeginning, this.imageUrls.length);
const scoreControl = new dlfViewerScoreControl(this, this.pagebeginning, this.imageUrls.length);
this.scoresLoaded_.then(function (scoreData) {
scoreControl.loadScoreData(scoreData, tk);

Expand Down Expand Up @@ -828,7 +828,11 @@ dlfViewer.prototype.init = function(controlNames) {

// Initiate loading fulltexts
this.initLoadFulltexts();
this.initLoadScores();

if (this.score !== '') {
// Initiate loading scores
this.initLoadScores();
}

var controls = controlNames.length > 0 || controlNames[0] === ""
? this.createControls_(controlNames, layers)
Expand Down

0 comments on commit 5161a46

Please sign in to comment.