@phila/phila-ui
Advanced tools
Comparing version 2.1.0-beta.33 to 2.1.0-beta.34
{ | ||
"name": "@phila/phila-ui", | ||
"version": "2.1.0-beta.33", | ||
"version": "2.1.0-beta.34", | ||
"description": "Phila-UI: City of Philadelphia Components Library", | ||
@@ -5,0 +5,0 @@ "author": "City of Philadelphia", |
@@ -108,3 +108,3 @@ export class Tooltip { | ||
//whem tooltip icon mouse over | ||
this.tooltipIcon.addEventListener('mouseover', function () { | ||
this.tooltipIcon.addEventListener('mouseenter', function () { | ||
self.updateTooltipPosition(); | ||
@@ -123,3 +123,3 @@ self.updateArrowPosition(); | ||
//when on mouse out | ||
this.tooltipIcon.addEventListener('mouseout', function () { | ||
this.tooltipIcon.addEventListener('mouseleave', function () { | ||
//on close if user did not click to open | ||
@@ -136,31 +136,19 @@ if (!self.clickedToOpen) { | ||
//if mobile, when clicking on the tooltipbox close it | ||
if (this.instance.isMobile || this.instance.isTablet) { | ||
this.tooltipBox.addEventListener('click', function () { | ||
self.updateTooltipPosition(); | ||
self.updateArrowPosition(); | ||
self.hideTooltip(); | ||
}, false); | ||
} | ||
//if clicked to open tooltip only allow clicking elsewhere to close it | ||
this.tooltipIcon.addEventListener('click', function () { | ||
self.clickedToOpen = true; | ||
self.updateTooltipPosition(); | ||
self.updateArrowPosition(); | ||
self.toggleTooltip(); | ||
}, false); | ||
//on desktop, clicking on tooltip icon keeps it open | ||
if (this.instance.isDesktop || this.instance.isWideScreen) { | ||
this.tooltipIcon.addEventListener('click', function () { | ||
self.clickedToOpen = true; | ||
self.updateTooltipPosition(); | ||
self.updateArrowPosition(); | ||
self.toggleTooltip(); | ||
}, false); | ||
//hide when clicking anywhere but on its own icon | ||
window.addEventListener('click', function (event) { | ||
if (event.target !== self.tooltipIcon && self.clickedToOpen) { | ||
self.hideTooltip(); | ||
self.clickedToOpen = false; | ||
} | ||
}); | ||
//hide when clicking anywhere but on its own icon | ||
window.addEventListener('click', function (event) { | ||
if (event.target !== self.tooltipIcon && self.clickedToOpen) { | ||
self.hideTooltip(); | ||
self.clickedToOpen = false; | ||
} | ||
}); | ||
} | ||
} | ||
@@ -167,0 +155,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2452462
94
6148