mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-4879 Deatach tooltip card when directive is destroyed (#6939)
This commit is contained in:
committed by
GitHub
parent
aed2208205
commit
d37608111a
@@ -14,13 +14,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ComponentRef, Directive, ElementRef, HostListener, Input, OnInit } from '@angular/core';
|
||||
import { ComponentRef, Directive, ElementRef, HostListener, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Overlay, OverlayPositionBuilder, OverlayRef } from '@angular/cdk/overlay';
|
||||
import { ComponentPortal } from '@angular/cdk/portal';
|
||||
import { TooltipCardComponent } from './tooltip-card.component';
|
||||
|
||||
@Directive({ selector: '[adf-tooltip-card]' })
|
||||
export class TooltipCardDirective implements OnInit {
|
||||
export class TooltipCardDirective implements OnInit, OnDestroy {
|
||||
|
||||
@Input('adf-tooltip-card') text = '';
|
||||
@Input() image = '';
|
||||
@@ -41,6 +41,10 @@ export class TooltipCardDirective implements OnInit {
|
||||
private elementRef: ElementRef) {
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.hide();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
const positionStrategy = this.overlayPositionBuilder
|
||||
.flexibleConnectedTo(this.elementRef)
|
||||
|
Reference in New Issue
Block a user