Fix action menu positioning
This commit is contained in:
@@ -197,9 +197,12 @@
|
||||
#urbm-app .bu-button.danger { color: var(--bu-bad) !important; }
|
||||
#urbm-app .bu-button:disabled { cursor: wait; opacity: .55; }
|
||||
.bu-action-menu { position: relative; }
|
||||
.bu-action-menu[open] { z-index: 80; }
|
||||
.bu-table tr.bu-menu-open, .bu-table tr.bu-menu-open > td { overflow: visible; position: relative; z-index: 70; }
|
||||
#urbm-app .bu-action-menu > summary { align-items: center; display: inline-flex; gap: 8px; list-style: none; }
|
||||
.bu-action-menu > summary::-webkit-details-marker { display: none; }
|
||||
.bu-action-menu-popover { background: var(--bu-panel); border: 1px solid var(--bu-border-strong); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.22); display: grid; min-width: 220px; padding: 6px; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; }
|
||||
.bu-action-menu-popover { background: var(--bu-panel); border: 1px solid var(--bu-border-strong); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.22); display: grid; max-height: min(430px, calc(100vh - 24px)); min-width: 220px; overflow-y: auto; padding: 6px; position: absolute; right: 0; top: calc(100% + 6px); z-index: 90; }
|
||||
.bu-action-menu.open-up .bu-action-menu-popover { bottom: calc(100% + 6px); top: auto; }
|
||||
#urbm-app .bu-action-menu-popover .bu-button { background: transparent !important; border-color: transparent !important; justify-content: flex-start; text-align: left; width: 100%; }
|
||||
#urbm-app .bu-action-menu-popover .bu-button:hover { background: var(--bu-panel-alt) !important; border-color: transparent !important; }
|
||||
#urbm-app .bu-action-menu-popover .bu-button.danger { border-top: 1px solid var(--bu-border) !important; border-radius: 0 !important; margin-top: 4px !important; }
|
||||
|
||||
@@ -977,6 +977,25 @@
|
||||
document.addEventListener('click', e=>{
|
||||
document.querySelectorAll('.bu-action-menu[open]').forEach(menu=>{ if(!menu.contains(e.target)) menu.removeAttribute('open'); });
|
||||
});
|
||||
content.addEventListener('toggle', e=>{
|
||||
const menu=e.target.closest?.('.bu-action-menu');
|
||||
if(!menu) return;
|
||||
const row=menu.closest('tr');
|
||||
row?.classList.toggle('bu-menu-open',menu.open);
|
||||
menu.classList.remove('open-up');
|
||||
if(!menu.open) return;
|
||||
content.querySelectorAll('.bu-action-menu[open]').forEach(other=>{ if(other!==menu) other.removeAttribute('open'); });
|
||||
requestAnimationFrame(()=>{
|
||||
const summary=menu.querySelector('summary');
|
||||
const popover=menu.querySelector('.bu-action-menu-popover');
|
||||
if(!summary||!popover) return;
|
||||
const rect=summary.getBoundingClientRect();
|
||||
const needed=Math.min(popover.scrollHeight,430);
|
||||
const below=window.innerHeight-rect.bottom-12;
|
||||
const above=rect.top-12;
|
||||
menu.classList.toggle('open-up',below<needed&&above>below);
|
||||
});
|
||||
},true);
|
||||
content.addEventListener('change', e => {
|
||||
if (e.target.name === 'type' && e.target.closest('#bu-repo-form')) {
|
||||
renderRepositorySpecific(e.target.value);
|
||||
|
||||
Reference in New Issue
Block a user