diff options
| author | Johann-S <[email protected]> | 2017-04-17 14:26:40 +0200 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2017-05-14 11:41:19 +0200 |
| commit | 53ee455bc735af9fc54de586ed4d23ac56b69ab8 (patch) | |
| tree | 8a29be55e1f709a3604c898360e0c31b8ac75cba /js/src | |
| parent | 69de65180f750cadf5f96a774d2524f69d19beab (diff) | |
| download | bootstrap-53ee455bc735af9fc54de586ed4d23ac56b69ab8.tar.xz bootstrap-53ee455bc735af9fc54de586ed4d23ac56b69ab8.zip | |
Handle dropup for Dropdown
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/dropdown.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index ce25e9671..33171cf20 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -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 |
