Skip to content
Snippets Groups Projects
Commit 6ed1aee9 authored by Alexander Reifschneider's avatar Alexander Reifschneider
Browse files

OZG-7619 Delete unnecessary if condition

parent 82d23e8e
Branches
No related tags found
1 merge request!64OZG-7619 Add role hints
......@@ -334,14 +334,6 @@ describe('TooltipDirective', () => {
directive.leftOffset = 0;
});
it('should set 0 offset, if parent wider than tooltip', () => {
const rectForStandard: DOMRect = { ...parentRect, left: 50, right: 500, width: 100 };
const result: number = directive.calculateLeftOffset(36, rectForStandard, 1000);
expect(result).toBe(0);
});
it('should set positive left offset', () => {
const rectForLeft: DOMRect = { ...parentRect, left: 10 };
......
......@@ -168,13 +168,9 @@ export class TooltipDirective implements OnDestroy {
}
calculateLeftOffset(tooltipWidth: number, parentRect: DOMRect, windowWidth: number): number {
const { left, right, width } = parentRect;
const { left, right } = parentRect;
const halfTooltipWidth: number = tooltipWidth / 2;
if (tooltipWidth < width) {
return 0;
}
if (halfTooltipWidth > left) {
return halfTooltipWidth - left;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment