mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 03:32:49 +08:00
Make sure dropdowns don't go above the edge of the screen
This commit is contained in:
parent
257ee936f4
commit
3be98b9f8e
|
@ -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