05/07: updated extension password item's more option has been covered
This commit is contained in:
@@ -1021,9 +1021,24 @@ function renderList() {
|
||||
flyout.appendChild(row);
|
||||
});
|
||||
|
||||
// Position flyout below the button, right-aligned.
|
||||
btn.style.position = "relative";
|
||||
btn.appendChild(flyout);
|
||||
// Position flyout using fixed coords so it escapes vault-list overflow clipping.
|
||||
const appEl = document.getElementById("app");
|
||||
appEl.appendChild(flyout);
|
||||
|
||||
const btnRect = btn.getBoundingClientRect();
|
||||
const flyoutH = flyout.offsetHeight || 120; // estimate if not yet painted
|
||||
const spaceBelow = window.innerHeight - btnRect.bottom;
|
||||
const flyoutW = flyout.offsetWidth || 160;
|
||||
|
||||
// Flip upward if not enough room below.
|
||||
if (spaceBelow < flyoutH + 8) {
|
||||
flyout.style.top = (btnRect.top - flyoutH - 4) + "px";
|
||||
} else {
|
||||
flyout.style.top = (btnRect.bottom + 4) + "px";
|
||||
}
|
||||
// Right-align with the button, but keep inside the popup.
|
||||
const rightEdge = window.innerWidth - btnRect.right;
|
||||
flyout.style.right = rightEdge + "px";
|
||||
|
||||
// Close on any outside click.
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user