diff --git a/package-lock.json b/package-lock.json index 2f0e3af8..66832d99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@d-i-t-a/reader", - "version": "2.3.7", + "version": "2.3.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@d-i-t-a/reader", - "version": "2.3.7", + "version": "2.3.8", "license": "Apache-2.0", "dependencies": { "@types/pdfjs-dist": "^2.7.4", diff --git a/package.json b/package.json index 27e78f97..35241d46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@d-i-t-a/reader", - "version": "2.3.7", + "version": "2.3.8", "description": "A viewer application for EPUB files.", "repository": "https://github.com/d-i-t-a/R2D2BC", "license": "Apache-2.0", diff --git a/src/modules/search/SearchModule.ts b/src/modules/search/SearchModule.ts index e2e72d5b..2f279770 100644 --- a/src/modules/search/SearchModule.ts +++ b/src/modules/search/SearchModule.ts @@ -161,9 +161,6 @@ export class SearchModule implements ReaderModule { self.currentChapterSearchResult = []; self.currentSearchHighlights = []; var localSearchResultChapter: any = []; - if (this.navigator.rights.enableContentProtection) { - this.navigator.contentProtectionModule?.deactivate(); - } await this.searchAndPaintChapter(searchVal, index, async (result) => { localSearchResultChapter = result; goToResultPage(1); @@ -292,6 +289,9 @@ export class SearchModule implements ReaderModule { index: number = 0, callback: (result: any) => any ) { + if (this.navigator.rights.enableContentProtection) { + this.navigator.contentProtectionModule?.deactivate(); + } const linkHref = this.publication.getAbsoluteHref( this.publication.readingOrder[this.navigator.currentResource() ?? 0].Href ); @@ -398,7 +398,11 @@ export class SearchModule implements ReaderModule { this.bookSearchResult = []; reset(); - await this.searchAndPaintChapter(term, 0, async () => {}); + await this.searchAndPaintChapter(term, 0, async () => { + if (this.navigator.rights.enableContentProtection) { + this.navigator.contentProtectionModule?.recalculate(200); + } + }); if (current) { await this.searchBook(term); @@ -452,7 +456,11 @@ export class SearchModule implements ReaderModule { this.searchAndPaintChapter( item.textMatch, filteredIndex, - async () => {} + async () => { + if (this.navigator.rights.enableContentProtection) { + this.navigator.contentProtectionModule?.recalculate(200); + } + } ); }, 300); } @@ -498,7 +506,11 @@ export class SearchModule implements ReaderModule { this.searchAndPaintChapter( item.textMatch, filteredIndex, - async () => {} + async () => { + if (this.navigator.rights.enableContentProtection) { + this.navigator.contentProtectionModule?.recalculate(200); + } + } ); }, 300); }