@br0ken/simpletooltip
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"homepage": "https://github.com/BR0kEN-/simpleTooltip", | ||
@@ -9,0 +9,0 @@ "description": "CSS tooltips with position control via JS.", |
@@ -33,2 +33,8 @@ /** | ||
function setup(hint) { | ||
if (hint.simpleTooltipProcessed) { | ||
return; | ||
} | ||
hint.simpleTooltipProcessed = true; | ||
var title = hint.getAttribute('title'); | ||
@@ -95,5 +101,5 @@ var hintStyle = window.getComputedStyle(hint); | ||
if (shift.length < 5) { | ||
var elementOffsetLeft = this.offsetLeft || this.parentNode.offsetLeft; | ||
var noPixelsAtRight = window.innerWidth - (elementOffsetLeft + this.offsetWidth + 20) < plugin.maxWidth; | ||
var noPixelsAtLeft = elementOffsetLeft - 20 < plugin.maxWidth; | ||
var dimensions = this.getBoundingClientRect(); | ||
var noPixelsAtRight = window.innerWidth - (dimensions.left + dimensions.width + 20) < plugin.maxWidth; | ||
var noPixelsAtLeft = dimensions.left - 20 < plugin.maxWidth; | ||
@@ -100,0 +106,0 @@ // Auto-positioning of the tooltip if it's wider than space to |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79331
465