Allow end-positioning a drop-down menu#5061
Conversation
|
FWIW in bootstrap3, the menus were end-aligned by default. Not sure if the change was intentional, I think largely it was a good change. But for menus on the right edge of the screen (we have an extra menu) it's a problem. |
EreMaijala
left a comment
There was a problem hiding this comment.
While I'm fine with adding the menuClass parameter it would be framework-specific, which is a thing to avoid when possible. So I think that alignment should be a top-level parameter to keep it framework-agnostic, or in other words to keep the implementation more opaque. Internally it would set the relevant bootstrap classes.
| ?> | ||
|
|
||
| <ul class="dropdown-menu"> | ||
| <ul class="dropdown-menu <?=$this->menuClass ?? '' ?>"> |
There was a problem hiding this comment.
Maybe use htmlAttributes helper for all attributes so that we can avoid any extra whitespace etc.
|
@EreMaijala I made both changes. Usage now
|
demiankatz
left a comment
There was a problem hiding this comment.
Looks reasonable to me, but I'll wait for @EreMaijala's final confirmation before merging. :-)
|
Looks good to me too. :) |
If the content of a menu item is wide, it can force the menu off the screen (creating a horizontal scroll bar):
This allows setting bootstrap classes on the dropdown-menu such as dropdown-menu-end, to right-align the menu.
In HeaderBar-allLangs.phtml:
'menuClass' => 'dropdown-menu-end',