From f1a040244114b96cbb84c7b39e12c8812c99a33a Mon Sep 17 00:00:00 2001 From: Mingze Xiao Date: Wed, 8 Apr 2020 16:18:10 -0700 Subject: [PATCH] feat(annotations): Hide annotations when fullscreen is active --- src/lib/constants.js | 1 + src/lib/viewers/BaseViewer.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/lib/constants.js b/src/lib/constants.js index b9afc41cb1..a7aaef5ad7 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -129,6 +129,7 @@ export const ANNOTATOR_EVENT = { fetch: 'annotationsfetched', error: 'annotationerror', scale: 'scaleannotations', + visibilityToggle: 'annotationvisibilitytoggle', }; export const BROWSERS = { diff --git a/src/lib/viewers/BaseViewer.js b/src/lib/viewers/BaseViewer.js index d267c0f0c5..cdb8b5690b 100644 --- a/src/lib/viewers/BaseViewer.js +++ b/src/lib/viewers/BaseViewer.js @@ -545,6 +545,7 @@ class BaseViewer extends EventEmitter { */ handleFullscreenEnter() { this.resize(); + this.emit(ANNOTATOR_EVENT.visibilityToggle); } /** @@ -554,6 +555,7 @@ class BaseViewer extends EventEmitter { */ handleFullscreenExit() { this.resize(); + this.emit(ANNOTATOR_EVENT.visibilityToggle); } /**