Skip to content

Commit

Permalink
Activate full text highlight if full text is active
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Oct 24, 2023
1 parent 9798a7c commit 8636cae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Resources/Public/JavaScript/PageView/FulltextControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ var dlfViewerFullTextControl = function(map) {
* @param {FullTextFeature} fulltextData
*/
dlfViewerFullTextControl.prototype.loadFulltextData = function (fulltextData) {
// remove previously inserted features
this.layers_.textblock.getSource().clear();
this.layers_.textline.getSource().clear();
this.layers_.select.getSource().clear();
this.textblocks_ = new dlfFulltextSegments();
this.textlines_ = new dlfFulltextSegments();

// add features to fulltext layer
this.textblockFeatures_ = fulltextData.getTextblocks();
this.layers_.textblock.getSource().addFeatures(this.textblockFeatures_);
Expand All @@ -256,6 +263,7 @@ dlfViewerFullTextControl.prototype.loadFulltextData = function (fulltextData) {
// If the control is *not* yet active, the fulltext is instead rendered on activation.
if (this.isActive) {
this.showFulltext(this.textblockFeatures_);
this.enableFulltextSelect();
}
}
};
Expand Down

0 comments on commit 8636cae

Please sign in to comment.