mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-14759] Fixed image viewer when going to full screen mode (#8609)
This commit is contained in:
@@ -369,6 +369,17 @@ describe('Test Img viewer component ', () => {
|
|||||||
expect(component.isSaving.emit).toHaveBeenCalledWith(true);
|
expect(component.isSaving.emit).toHaveBeenCalledWith(true);
|
||||||
expect(component.isSaving.emit).toHaveBeenCalledWith(false);
|
expect(component.isSaving.emit).toHaveBeenCalledWith(false);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should reset the viewer after going to full screen mode', () => {
|
||||||
|
Object.defineProperty(document, 'fullscreenElement', {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
spyOn(component, 'reset');
|
||||||
|
|
||||||
|
document.dispatchEvent(new Event('fullscreenchange'));
|
||||||
|
|
||||||
|
expect(component.reset).toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -141,6 +141,13 @@ export class ImgViewerComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HostListener('document:fullscreenchange')
|
||||||
|
fullScreenChangeHandler() {
|
||||||
|
if(document.fullscreenElement) {
|
||||||
|
this.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
const blobFile = changes['blobFile'];
|
const blobFile = changes['blobFile'];
|
||||||
if (blobFile && blobFile.currentValue) {
|
if (blobFile && blobFile.currentValue) {
|
||||||
|
Reference in New Issue
Block a user