diff --git a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts index a0288b9ea4..0f45628d80 100644 --- a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts +++ b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts @@ -140,7 +140,7 @@ describe('DiagramTooltipComponent', () => { }); it('should NOT show the tooltip by default', () => { - const tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.is-active')); + const tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).toBeNull(); }); @@ -150,7 +150,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseenter')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.is-active')); + let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).not.toBeNull(); }); @@ -159,7 +159,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('touchend')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.is-active')); + let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).not.toBeNull(); }); @@ -169,7 +169,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseenter')); tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseleave')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.is-active')); + let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).toBeNull(); }); @@ -179,7 +179,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseenter')); window.dispatchEvent(new CustomEvent('scroll')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.is-active')); + let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).toBeNull(); }); @@ -189,7 +189,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('touchend')); window.dispatchEvent(new CustomEvent('touchstart')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.is-active')); + let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).toBeNull(); }); }); diff --git a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts index 4ff3eabc6c..c616ce05f1 100644 --- a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts +++ b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts @@ -15,12 +15,12 @@ * limitations under the License. */ - /* tslint:disable:component-selector */ +/* tslint:disable:component-selector */ import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core'; -const POSITION = { BOTTOM: 'bottom', LEFT: 'left', RIGHT: 'right', TOP: 'top'}; -const STRATEGY = { CURSOR: 'cursor', ELEMENT: 'element'}; -const IS_ACTIVE_CLASS = 'is-active'; +const POSITION = { BOTTOM: 'bottom', LEFT: 'left', RIGHT: 'right', TOP: 'top' }; +const STRATEGY = { CURSOR: 'cursor', ELEMENT: 'element' }; +const IS_ACTIVE_CLASS = 'adf-is-active'; @Component({ selector: 'diagram-tooltip', @@ -100,10 +100,10 @@ export class DiagramTooltipComponent implements AfterViewInit, OnDestroy { private handleMouseEnter(event): void { let props; - if (this.strategy === STRATEGY.ELEMENT ) { + if (this.strategy === STRATEGY.ELEMENT) { props = event.target.getBoundingClientRect(); } else { - props = {top: (event.pageY - 150), left: event.pageX , width: event.layerX, height: 50}; + props = { top: (event.pageY - 150), left: event.pageX, width: event.layerX, height: 50 }; } let top = props.top + (props.height / 2);