mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 05:55:15 +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()
|
$menu.offset().top + $menu.height() > $(window).scrollTop() + $(window).height()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($menu.offset().top < 0) {
|
||||||
|
$menu.removeClass('Dropdown-menu--top');
|
||||||
|
}
|
||||||
|
|
||||||
$menu.toggleClass(
|
$menu.toggleClass(
|
||||||
'Dropdown-menu--right',
|
'Dropdown-menu--right',
|
||||||
isRight || $menu.offset().left + $menu.width() > $(window).scrollLeft() + $(window).width()
|
isRight || $menu.offset().left + $menu.width() > $(window).scrollLeft() + $(window).width()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user