Merge branch 'RED-7605' into 'master'
RED-7605: Fixed search. See merge request redactmanager/red-ui!94
This commit is contained in:
commit
d7b2943ecf
@ -382,7 +382,7 @@ export class FilePreviewScreenComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('window:keyup', ['$event'])
|
@HostListener('document:keyup', ['$event'])
|
||||||
handleKeyEvent($event: KeyboardEvent) {
|
handleKeyEvent($event: KeyboardEvent) {
|
||||||
if (this._router.url.indexOf('/file/') < 0) {
|
if (this._router.url.indexOf('/file/') < 0) {
|
||||||
return;
|
return;
|
||||||
@ -396,6 +396,7 @@ export class FilePreviewScreenComponent
|
|||||||
this.fullScreen = false;
|
this.fullScreen = false;
|
||||||
this.closeFullScreen();
|
this.closeFullScreen();
|
||||||
this.pdf.deactivateSearch();
|
this.pdf.deactivateSearch();
|
||||||
|
window.focus();
|
||||||
this._changeRef.markForCheck();
|
this._changeRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -102,6 +102,10 @@ export class PdfViewer {
|
|||||||
return page$.pipe(map(page => this.#adjustPage(page)));
|
return page$.pipe(map(page => this.#adjustPage(page)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get searchActive() {
|
||||||
|
return this.instance.UI.isElementOpen('searchPanel');
|
||||||
|
}
|
||||||
|
|
||||||
focusSearch() {
|
focusSearch() {
|
||||||
const iframeWindow = this.#instance.UI.iframeWindow;
|
const iframeWindow = this.#instance.UI.iframeWindow;
|
||||||
const input = iframeWindow.document.getElementById('SearchPanel__input') as HTMLInputElement;
|
const input = iframeWindow.document.getElementById('SearchPanel__input') as HTMLInputElement;
|
||||||
@ -260,8 +264,13 @@ export class PdfViewer {
|
|||||||
#listenForCommandF() {
|
#listenForCommandF() {
|
||||||
this.#instance.UI.hotkeys.on('command+f, ctrl+f', e => {
|
this.#instance.UI.hotkeys.on('command+f, ctrl+f', e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.activateSearch();
|
if (!this.searchActive) {
|
||||||
this.focusSearch();
|
this.activateSearch();
|
||||||
|
this.focusSearch();
|
||||||
|
}
|
||||||
|
if (this.documentViewer.getSelectedText()) {
|
||||||
|
this.#searchForSelectedText();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user