Popover menu: Refactor to remove the necessity of coupling JS and PHP code to instantiate it correctly

This commit is contained in:
Molkobain
2021-03-22 13:21:31 +01:00
parent e8656e8504
commit 65ed5b3fce
14 changed files with 409 additions and 137 deletions

View File

@@ -49,7 +49,10 @@ class PopoverMenuFactory
public static function MakeUserMenuForNavigationMenu()
{
$oMenu = new PopoverMenu('ibo-navigation-menu--user-menu');
$oMenu->SetTogglerJSSelector('[data-role="ibo-navigation-menu--user-menu--toggler"]');
$oMenu->SetTogglerJSSelector('[data-role="ibo-navigation-menu--user-menu--toggler"]')
->SetContainer(PopoverMenu::ENUM_CONTAINER_BODY)
->SetHorizontalPosition(PopoverMenu::ENUM_HORIZONTAL_POSITION_ALIGN_OUTER_RIGHT)
->SetVerticalPosition(PopoverMenu::ENUM_VERTICAL_POSITION_ABOVE);
// Allowed portals
$aAllowedPortalsItems = static::PrepareAllowedPortalsItemsForUserMenu();