aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2017-09-07 12:47:43 +0200
committerJohann-S <[email protected]>2017-09-07 13:51:25 +0200
commitb822b5a17f87c62000ec3a058e3f2ccca8a10d3e (patch)
treedb7a60bc105cf0c68ab9712cd9906c93f226068e
parent7983ba9473142c6844d6554a28e58ecbf14190da (diff)
downloadbootstrap-b822b5a17f87c62000ec3a058e3f2ccca8a10d3e.tar.xz
bootstrap-b822b5a17f87c62000ec3a058e3f2ccca8a10d3e.zip
Remove placement attribute from our Dropdown plugin
-rw-r--r--docs/4.0/components/dropdowns.md10
-rw-r--r--js/src/dropdown.js11
2 files changed, 3 insertions, 18 deletions
diff --git a/docs/4.0/components/dropdowns.md b/docs/4.0/components/dropdowns.md
index 93c9c892a..9c611c629 100644
--- a/docs/4.0/components/dropdowns.md
+++ b/docs/4.0/components/dropdowns.md
@@ -574,7 +574,7 @@ Regardless of whether you call your dropdown via JavaScript or instead use the d
### Options
-Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-placement=""`.
+Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-offset=""`.
<table class="table table-bordered table-striped table-responsive">
<thead>
@@ -587,14 +587,6 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</thead>
<tbody>
<tr>
- <td>placement</td>
- <td>string</td>
- <td>'bottom'</td>
- <td>
- <p>How to position the popover - top | bottom.</p>
- </td>
- </tr>
- <tr>
<td>offset</td>
<td>number | string</td>
<td>0</td>
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index adb54f0f2..f76f84ef0 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -75,13 +75,11 @@ const Dropdown = (() => {
}
const Default = {
- placement : AttachmentMap.BOTTOM,
offset : 0,
flip : true
}
const DefaultType = {
- placement : 'string',
offset : '(number|string)',
flip : 'boolean'
}
@@ -203,11 +201,6 @@ const Dropdown = (() => {
}
_getConfig(config) {
- const elementData = $(this._element).data()
- if (typeof elementData.placement !== 'undefined') {
- elementData.placement = AttachmentMap[elementData.placement.toUpperCase()]
- }
-
config = $.extend(
{},
this.constructor.Default,
@@ -234,10 +227,10 @@ const Dropdown = (() => {
_getPlacement() {
const $parentDropdown = $(this._element).parent()
- let placement = this._config.placement
+ let placement = AttachmentMap.BOTTOM
// Handle dropup
- if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) {
+ if ($parentDropdown.hasClass(ClassName.DROPUP)) {
placement = AttachmentMap.TOP
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.TOPEND