1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 07:37:27 +02:00

Allow to disable flip behaviour on Dropdown + documentation

This commit is contained in:
Johann-S
2017-04-21 10:49:04 +02:00
parent 65d0d9831a
commit 4f882a840c
2 changed files with 19 additions and 3 deletions

View File

@@ -71,12 +71,14 @@ const Dropdown = (($) => {
const Default = {
placement : AttachmentMap.BOTTOM,
offset : 0
offset : 0,
flip : true
}
const DefaultType = {
placement : 'string',
offset : '(number|string)'
offset : '(number|string)',
flip : 'boolean'
}
@@ -153,6 +155,9 @@ const Dropdown = (($) => {
modifiers : {
offset : {
offset : context._config.offset
},
flip : {
enabled : context._config.flip
}
}
})
@@ -201,6 +206,11 @@ const Dropdown = (($) => {
}
_getConfig(config) {
const elementData = $(this._element).data()
if (elementData.placement !== undefined) {
elementData.placement = AttachmentMap[elementData.placement.toUpperCase()]
}
config = $.extend(
{},
this.constructor.Default,