Merge branch 'VM/DM-426' into 'master'

DM-426 - Enable layout grid button needs two clicks in new file

Closes DM-426

See merge request redactmanager/red-ui!66
This commit is contained in:
Dan Percic 2023-09-11 17:05:02 +02:00
commit 1c5d8a340c
3 changed files with 14 additions and 0 deletions

View File

@ -338,6 +338,7 @@ export class FilePreviewScreenComponent
document.documentElement.addEventListener('fullscreenchange', this.fullscreenListener);
this.#openRssDialogIfDefault();
this._viewerHeaderService.resetLayers();
}
ngAfterViewInit() {

View File

@ -33,6 +33,11 @@ export class LayersService {
return tooltipsDisabled ? this.#enableIcon : this.#disableIcon;
}
resetLayers() {
this._active = false;
this.#updateButton();
}
async toggleLayers(): Promise<void> {
const layers = await this._documentViewer.document.getLayersArray();
layers.forEach(layer => {
@ -45,6 +50,10 @@ export class LayersService {
this._documentViewer.refreshAndUpdateView();
this._active = !this._active;
this.#updateButton();
}
#updateButton() {
this._pdf.instance.UI.updateElement(HeaderElements.TOGGLE_LAYERS, {
title: this.toggleLayersBtnTitle,
img: this.toggleLayersBtnIcon,

View File

@ -377,4 +377,8 @@ export class ViewerHeaderService {
this.disable(ROTATION_ACTION_BUTTONS);
}
}
resetLayers() {
this._layersService.resetLayers();
}
}