1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-09 15:16:51 +02:00

Handle dropup for Dropdown

This commit is contained in:
Johann-S
2017-04-17 14:26:40 +02:00
parent 69de65180f
commit 53ee455bc7
4 changed files with 31 additions and 10 deletions

View File

@@ -64,8 +64,13 @@ const Dropdown = (($) => {
VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled)'
}
const AttachmentMap = {
TOP : 'top',
BOTTOM : 'bottom'
}
const Default = {
placement : 'bottom',
placement : AttachmentMap.BOTTOM,
offset : 0
}
@@ -141,8 +146,10 @@ const Dropdown = (($) => {
return false
}
// Handle dropup
const dropdownPlacement = $(this).parent().hasClass('dropup') ? AttachmentMap.TOP : context._config.placement
this._popper = new Popper(this, context._menu, {
placement : context._config.placement,
placement : dropdownPlacement,
modifiers : {
offset : {
offset : context._config.offset