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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user