Skip to content

Commit

Permalink
Issue TreyWW#304 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Fisher committed Dec 13, 2024
1 parent f3e4870 commit 7b030be
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frontend/templates/pages/invoices/dashboard/_fetch_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@
<td colspan="2"
onclick="const e = arguments[0] || window.event; e.stopPropagation();"
class="cursor-default">
{# The if statement for dropdown top goes as follows #}
{# Use dropdown on top if these: #}
{# - is last item (and not first item) (and more than 4 items) #}
<!-- Only last two invoices need a dropup -->
<div class="dropdown dropdown-left {% if forloop.counter0 > 3 %}dropdown-top{% endif %}">
<div class="dropdown dropdown-left" x-data="{ openUp: false }" x-init="() => {
const checkDropdownPosition = () => {
const rect = $el.getBoundingClientRect();
const dropdownHeight = $el.querySelector('.dropdown-content').offsetHeight;
openUp = (rect.bottom + dropdownHeight) > window.innerHeight || (rect.top - dropdownHeight) < 0;
};
checkDropdownPosition();
window.addEventListener('scroll', checkDropdownPosition);
}" :class="{ 'dropdown-top': openUp }">
<label tabindex="0" class="btn btn-primary btn-outline btn-sm">
<i class="fa-solid fa-ellipsis-vertical"></i>
</label>
Expand Down

0 comments on commit 7b030be

Please sign in to comment.