(event)
| 31 | } |
| 32 | |
| 33 | mouseOver(event) { |
| 34 | const { target } = event; |
| 35 | const toolTipTarget = target.closest('[data-tooltip]'); |
| 36 | const { eventCenter } = this._muya; |
| 37 | if (toolTipTarget && !this._cache.has(toolTipTarget)) { |
| 38 | const tooltip = toolTipTarget.getAttribute('data-tooltip'); |
| 39 | const tooltipEle = document.createElement('div'); |
| 40 | tooltipEle.textContent = tooltip; |
| 41 | tooltipEle.classList.add('mu-tooltip'); |
| 42 | document.body.appendChild(tooltipEle); |
| 43 | position(toolTipTarget, tooltipEle); |
| 44 | |
| 45 | this._cache.set(toolTipTarget, tooltipEle); |
| 46 | |
| 47 | setTimeout(() => { |
| 48 | tooltipEle.classList.add('active'); |
| 49 | }); |
| 50 | |
| 51 | const timer = setInterval(() => { |
| 52 | if (!document.body.contains(toolTipTarget)) { |
| 53 | this.mouseLeave({ target: toolTipTarget }); |
| 54 | clearInterval(timer); |
| 55 | } |
| 56 | }, 300); |
| 57 | |
| 58 | eventCenter.attachDOMEvent( |
| 59 | toolTipTarget, |
| 60 | 'mouseleave', |
| 61 | this.mouseLeave.bind(this), |
| 62 | ); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | mouseLeave(event) { |
| 67 | const { target } = event; |
nothing calls this directly
no test coverage detected