(_time)
| 248 | |
| 249 | let timeouts = []; |
| 250 | function closeAfter(_time) { |
| 251 | timeouts.forEach((t) => clearTimeout(t)); |
| 252 | timeouts = [ |
| 253 | setTimeout(() => { |
| 254 | if (div) { |
| 255 | div.style.opacity = 0; |
| 256 | div.style.top = `${y - 50}px`; |
| 257 | } |
| 258 | }, _time - 1000), |
| 259 | setTimeout(() => { |
| 260 | div?.remove(); |
| 261 | }, _time), |
| 262 | ]; |
| 263 | } |
| 264 | |
| 265 | closeAfter(duration); |
| 266 |
no test coverage detected