Skip to content

Commit bf0fb1c

Browse files
Merge pull request #28 from digma-ai/fix/types
Improve types for document body
2 parents cb4861c + 2f30c37 commit bf0fb1c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/jaeger-ui/src/utils/ZoomManager.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@ const MIN_ZOOM_LEVEL = 0.7;
22
const MAX_ZOOM_LEVEL = 1.5;
33
const ZOOM_FACTOR = 0.1;
44

5+
interface IChromeCSSStyleDeclaration extends CSSStyleDeclaration {
6+
zoom: number | string;
7+
}
8+
59
export default class ZoomManager {
610
zoomLevel: number;
711

812
constructor() {
9-
this.zoomLevel = document.body.style.zoom || 1;
13+
this.zoomLevel =
14+
typeof (document.body.style as IChromeCSSStyleDeclaration).zoom === 'number'
15+
? ((document.body.style as IChromeCSSStyleDeclaration).zoom as number)
16+
: 1;
1017
}
1118

1219
updateStyles = () => {
13-
document.body.style.zoom = this.zoomLevel;
20+
(document.body.style as IChromeCSSStyleDeclaration).zoom = this.zoomLevel;
1421
};
1522

1623
zoomIn = () => {

0 commit comments

Comments
 (0)