Pull request #2: red-404

Merge in RED/ui from red-404 to master

* commit '439aa88aeec0dcdb147c19d967f9f52e09c2b339':
  Clean text popup
  Clean header
This commit is contained in:
Timo Bejan 2020-10-08 10:13:12 +02:00
commit 56a4fb6b2d

View File

@ -70,6 +70,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnDestroy {
this.wvInstance = instance;
this._viewerSyncService.registerViewer(this.fileType, this.wvInstance);
this._configureTextPopup();
this._configureHeader();
instance.docViewer.on('documentLoaded', this.wvDocumentLoadedHandler)
instance.loadDocument(pdfBlob, {filename: this.fileStatus ? this.fileStatus.filename : 'file.pdf'});
this.fileReady.emit();
@ -101,6 +102,14 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnDestroy {
}
private _configureTextPopup() {
this.wvInstance.disableElements([
'textHighlightToolButton',
'textUnderlineToolButton',
'textSquigglyToolButton',
'textStrikeoutToolButton',
'linkButton',
]);
this.wvInstance.textPopup.add(<any>{
type: 'actionButton',
img: '/assets/icons/general/add.svg',
@ -112,6 +121,11 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnDestroy {
});
}
private _configureHeader() {
this.wvInstance.disableElements(['ribbons']);
this.wvInstance.setToolbarGroup('toolbarGroup-View');
}
ngOnDestroy(): void {
this._viewerSyncService.deregisterInstance(this.fileType);
}