fix(bundle): mirror source fixes in embedded userscript

This commit is contained in:
dev
2026-06-07 09:00:40 -05:00
parent 2ed25c14de
commit 7fddd84b6a
+2 -2
View File
@@ -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());