RED-6285: fix save button not hidden
This commit is contained in:
parent
7ba8b51f8a
commit
5eab66c79e
@ -1,7 +1,7 @@
|
||||
<div class="content-container">
|
||||
<div #viewer class="viewer" id="viewer"></div>
|
||||
|
||||
<div *ngIf="changed && currentUser.isAdmin" class="changes-box">
|
||||
<div *ngIf="!!instance && changed && currentUser.isAdmin" class="changes-box">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="!valid"
|
||||
|
||||
@ -63,9 +63,9 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
];
|
||||
readonly orientationOptions = ['DIAGONAL', 'HORIZONTAL', 'VERTICAL'];
|
||||
@ViewChild('viewer', { static: true }) viewer: ElementRef<HTMLDivElement>;
|
||||
instance: WebViewerInstance;
|
||||
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
||||
readonly #watermarkId = Number(getParam(WATERMARK_ID));
|
||||
private _instance: WebViewerInstance;
|
||||
private _watermark: Partial<IWatermark> = {};
|
||||
|
||||
constructor(
|
||||
@ -152,11 +152,11 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
}
|
||||
|
||||
private async _loadViewer() {
|
||||
if (this._instance) {
|
||||
if (this.instance) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._instance = await WebViewer(
|
||||
this.instance = await WebViewer(
|
||||
{
|
||||
licenseKey: this._licenseService.activeLicenseKey,
|
||||
path: this._convertPath('/assets/wv-resources'),
|
||||
@ -168,15 +168,15 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
this.viewer.nativeElement,
|
||||
);
|
||||
|
||||
this._instance.UI.setTheme(this._userPreferenceService.getTheme());
|
||||
this.instance.UI.setTheme(this._userPreferenceService.getTheme());
|
||||
|
||||
this._instance.Core.documentViewer.addEventListener('documentLoaded', async () => {
|
||||
this.instance.Core.documentViewer.addEventListener('documentLoaded', async () => {
|
||||
this._loadingService.stop();
|
||||
await this._drawWatermark();
|
||||
});
|
||||
|
||||
if (environment.production) {
|
||||
this._instance.Core.setCustomFontURL('https://' + window.location.host + this._convertPath('/assets/pdftron'));
|
||||
this.instance.Core.setCustomFontURL('https://' + window.location.host + this._convertPath('/assets/pdftron'));
|
||||
}
|
||||
|
||||
this._disableElements();
|
||||
@ -185,16 +185,16 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
responseType: 'blob',
|
||||
});
|
||||
const blobData = await firstValueFrom(request);
|
||||
this._instance.UI.loadDocument(blobData, { filename: 'blank.pdf' });
|
||||
this.instance.UI.loadDocument(blobData, { filename: 'blank.pdf' });
|
||||
}
|
||||
|
||||
private _disableElements() {
|
||||
this._instance.UI.disableElements(['header', 'toolsHeader', 'pageNavOverlay', 'textPopup']);
|
||||
this.instance.UI.disableElements(['header', 'toolsHeader', 'pageNavOverlay', 'textPopup']);
|
||||
}
|
||||
|
||||
private async _drawWatermark() {
|
||||
const pdfNet = this._instance.Core.PDFNet;
|
||||
const document = await this._instance.Core.documentViewer.getDocument().getPDFDoc();
|
||||
const pdfNet = this.instance.Core.PDFNet;
|
||||
const document = await this.instance.Core.documentViewer.getDocument().getPDFDoc();
|
||||
|
||||
await stampPDFPage(
|
||||
document,
|
||||
@ -208,8 +208,8 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
[1],
|
||||
this._licenseService.activeLicenseKey,
|
||||
);
|
||||
this._instance.Core.documentViewer.refreshAll();
|
||||
this._instance.Core.documentViewer.updateView([0], 0);
|
||||
this.instance.Core.documentViewer.refreshAll();
|
||||
this.instance.Core.documentViewer.updateView([0], 0);
|
||||
}
|
||||
|
||||
private _getForm() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user