| 8276 | }; |
| 8277 | |
| 8278 | let mouseMoveHandler = e => { |
| 8279 | if (moving) { |
| 8280 | let windowHeight = window.innerHeight || document.documentElement.clientHeight; |
| 8281 | let windowWidth = window.innerWidth || document.documentElement.clientWidth; |
| 8282 | perX = (clientX(e) - 10 + 40) / windowWidth * 100; |
| 8283 | perY = (clientY(e) - 83 + 83) / windowHeight * 100; |
| 8284 | this.frame.style.top = `calc(${perY}% - 83px)`; |
| 8285 | this.frame.style.left = `calc(${perX}% - 40px)`; |
| 8286 | } else if (Math.abs(clientX(e) - initX) + Math.abs(clientY(e) - initY) > 5) { |
| 8287 | moving = true; |
| 8288 | clearTimeout(removeTimer); |
| 8289 | } |
| 8290 | }; |
| 8291 | let mouseUpHandler = e => { |
| 8292 | clearTimeout(removeTimer); |
| 8293 | document.removeEventListener("mousemove", mouseMoveHandler, true); |