()
| 13 | new Debouncer((...args) => this._setData(...args), 500) |
| 14 | |
| 15 | constructor() { |
| 16 | super(templateText); |
| 17 | this._intersectionObserver = new IntersectionObserver((entries) => { |
| 18 | if (entries[0].intersectionRatio <= 0) { |
| 19 | this.hide(); |
| 20 | } else { |
| 21 | this.show(); |
| 22 | this.requestUpdate(true); |
| 23 | } |
| 24 | }); |
| 25 | document.addEventListener('click', (event) => { |
| 26 | // Only hide the tooltip if we click anywhere outside of it. |
| 27 | let target = event.target; |
| 28 | while (target) { |
| 29 | if (target == this) return; |
| 30 | target = target.parentNode; |
| 31 | } |
| 32 | this.hide() |
| 33 | }); |
| 34 | } |
| 35 | |
| 36 | _update() { |
| 37 | if (!this._targetNode || this._isHidden) return; |
nothing calls this directly
no test coverage detected