mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 13:36:10 +08:00
Make sure dropdowns don't go above the edge of the screen
This commit is contained in:
parent
a6553954e2
commit
9682cd5f26
|
@ -69,6 +69,10 @@ export default class Dropdown extends Component {
|
|||
$menu.offset().top + $menu.height() > $(window).scrollTop() + $(window).height()
|
||||
);
|
||||
|
||||
if ($menu.offset().top < 0) {
|
||||
$menu.removeClass('Dropdown-menu--top');
|
||||
}
|
||||
|
||||
$menu.toggleClass(
|
||||
'Dropdown-menu--right',
|
||||
isRight || $menu.offset().left + $menu.width() > $(window).scrollLeft() + $(window).width()
|
||||
|
|
Loading…
Reference in New Issue
Block a user