From 7fddd84b6ad0f9fcd7ab9d8a10c2fb9b2d63ff0c Mon Sep 17 00:00:00 2001 From: dev Date: Sun, 7 Jun 2026 09:00:40 -0500 Subject: [PATCH] fix(bundle): mirror source fixes in embedded userscript --- torn-attribute-tracker.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torn-attribute-tracker.user.js b/torn-attribute-tracker.user.js index a0206da..19780bf 100644 --- a/torn-attribute-tracker.user.js +++ b/torn-attribute-tracker.user.js @@ -356,6 +356,7 @@ else { this.root.style.top = '20px'; this.root.style.left = '50%'; this.root.style.transform = 'translateX(-50%)'; } } _positionAnchored(rect) { + if (!rect) return; // defensive: setMode may be called without a rect const dialogRect = this.root.getBoundingClientRect(); let top = rect.top - dialogRect.height - 8; if (top < 8) top = 20; @@ -516,8 +517,7 @@ const el = findAnchorElement(); if (el) { const rect = el.getBoundingClientRect(); - dialog.setMode('anchored', { canAnchor: true }); - dialog._positionAnchored(rect); + dialog.setMode('anchored', { canAnchor: true, rect: rect }); if (typeof ResizeObserver !== 'undefined') { const ro = new ResizeObserver(function () { if (prefs.mode === 'anchored') dialog._positionAnchored(el.getBoundingClientRect());