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:
commit
1c5d8a340c
@ -338,6 +338,7 @@ export class FilePreviewScreenComponent
|
||||
document.documentElement.addEventListener('fullscreenchange', this.fullscreenListener);
|
||||
|
||||
this.#openRssDialogIfDefault();
|
||||
this._viewerHeaderService.resetLayers();
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -377,4 +377,8 @@ export class ViewerHeaderService {
|
||||
this.disable(ROTATION_ACTION_BUTTONS);
|
||||
}
|
||||
}
|
||||
|
||||
resetLayers() {
|
||||
this._layersService.resetLayers();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user