BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
let tooltip: Tooltip = new Tooltip({
cssClass: ' tooltiptarget', //must be unique
});
document.addEventListener("click", (args) => {
let targetElement = document.getElementById("target");
//open the tooltip
if(args.target==targetElement)
{
tooltip.open(targetElement);
}
if (args.target != targetElement)
{
//check click element target is not inside the tooltip
if (!(args.target as any).closest(".tooltiptarget"))
{
tooltip.close();
}
//close tooltip by click the button inside the tooltip component
if(args.target && (args.target as any).id=="btnclose")
{
tooltip.close();
}
}
} |