fix(bundle): mirror source fixes in embedded userscript
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user