| 766 | |
| 767 | |
| 768 | function bindDragAutoScroll() { |
| 769 | if (window.__FR_FLAGS.wired.dragScroll) return; |
| 770 | window.__FR_FLAGS.wired.dragScroll = true; |
| 771 | |
| 772 | const THRESH = 50; |
| 773 | const SPEED = 20; |
| 774 | document.addEventListener('dragover', (e) => { |
| 775 | const y = e && typeof e.clientY === 'number' ? e.clientY : null; |
| 776 | if (y == null) return; |
| 777 | if (y < THRESH) window.scrollBy(0, -SPEED); |
| 778 | else if (y > (window.innerHeight - THRESH)) window.scrollBy(0, SPEED); |
| 779 | }, { passive: true }); |
| 780 | } |
| 781 | |
| 782 | function bindClickIfMissing(id, fnName) { |
| 783 | const el = document.getElementById(id); |