### 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>
</tr>
</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>
}
const Default = {
- placement : AttachmentMap.BOTTOM,
offset : 0,
flip : true
}
const DefaultType = {
- placement : 'string',
offset : '(number|string)',
flip : 'boolean'
}
}
_getConfig(config) {
- const elementData = $(this._element).data()
- if (typeof elementData.placement !== 'undefined') {
- elementData.placement = AttachmentMap[elementData.placement.toUpperCase()]
- }
-
config = $.extend(
{},
this.constructor.Default,
_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