Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion frontend/src/routes/admin/links/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,22 @@
dropdownPosition = null;
} else {
activeDropdown = linkId;

// Estimate dropdown height (~5 items at ~33px each + padding ≈ 200px)
const estimatedMenuHeight = 200;
const spaceBelow = window.innerHeight - rect.bottom;

let top: number;
if (spaceBelow < estimatedMenuHeight && rect.top > estimatedMenuHeight) {
// Not enough space below, open upward
top = rect.top - estimatedMenuHeight - 4;
} else {
// Default: open below
top = rect.bottom + 4;
}

dropdownPosition = {
top: rect.bottom + 4,
top,
right: window.innerWidth - rect.right
};
}
Expand Down
16 changes: 15 additions & 1 deletion frontend/src/routes/admin/users/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,22 @@
dropdownPosition = null;
} else {
activeDropdown = userId;

// Estimate dropdown height (~5 items at ~33px each + padding ≈ 200px)
const estimatedMenuHeight = 200;
const spaceBelow = window.innerHeight - rect.bottom;

let top: number;
if (spaceBelow < estimatedMenuHeight && rect.top > estimatedMenuHeight) {
// Not enough space below, open upward
top = rect.top - estimatedMenuHeight - 4;
} else {
// Default: open below
top = rect.bottom + 4;
}

dropdownPosition = {
top: rect.bottom + 4,
top,
right: window.innerWidth - rect.right
};
}
Expand Down
Loading