aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2017-04-21 10:49:04 +0200
committerJohann-S <[email protected]>2017-05-14 11:41:19 +0200
commit4f882a840c9f2b62f543c32d56b3e904582ced90 (patch)
treedf5deaa483317cde922456c8d82f7712997c6dcc /js/src
parent65d0d9831ad1dbf70c0ac702bbf1fc5b3e965805 (diff)
downloadbootstrap-4f882a840c9f2b62f543c32d56b3e904582ced90.tar.xz
bootstrap-4f882a840c9f2b62f543c32d56b3e904582ced90.zip
Allow to disable flip behaviour on Dropdown + documentation
Diffstat (limited to 'js/src')
-rw-r--r--js/src/dropdown.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index 0c082edd6..71247728a 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -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,