@mixd-id/web-scaffold 0.1.230406231 → 0.1.230406232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +5 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -314,9 +314,11 @@ export default{
|
|
|
314
314
|
const uid = el.getAttribute('data-tooltip')
|
|
315
315
|
const tooltip = tooltips[uid]
|
|
316
316
|
const rect = el.getBoundingClientRect()
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
317
|
+
if(rect && rect.width > 0){
|
|
318
|
+
tooltip.style.top = (rect.y + rect.height + 10) + 'px'
|
|
319
|
+
tooltip.style.left = rect.x - (Math.round((tooltip.clientWidth - rect.width) / 2)) + 'px'
|
|
320
|
+
tooltip.classList.add('active')
|
|
321
|
+
}
|
|
320
322
|
}
|
|
321
323
|
}, 1300)
|
|
322
324
|
el.setAttribute('data-tooltip-open', true)
|