($element)
| 2199 | containerPos, |
| 2200 | actualHeight, |
| 2201 | getPlacement = function ($element) { |
| 2202 | var containerPosition = {}, |
| 2203 | // fall back to dropdown's default display setting if display is not manually set |
| 2204 | display = that.options.display || ( |
| 2205 | // Bootstrap 3 doesn't have $.fn.dropdown.Constructor.Default |
| 2206 | $.fn.dropdown.Constructor.Default ? $.fn.dropdown.Constructor.Default.display |
| 2207 | : false |
| 2208 | ); |
| 2209 | |
| 2210 | that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass(classNames.DROPUP, $element.hasClass(classNames.DROPUP)); |
| 2211 | pos = $element.offset(); |
| 2212 | |
| 2213 | if (!$container.is('body')) { |
| 2214 | containerPos = $container.offset(); |
| 2215 | containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop(); |
| 2216 | containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft(); |
| 2217 | } else { |
| 2218 | containerPos = { top: 0, left: 0 }; |
| 2219 | } |
| 2220 | |
| 2221 | actualHeight = $element.hasClass(classNames.DROPUP) ? 0 : $element[0].offsetHeight; |
| 2222 | |
| 2223 | // Bootstrap 4+ uses Popper for menu positioning |
| 2224 | if (version.major < 4 || display === 'static') { |
| 2225 | containerPosition.top = pos.top - containerPos.top + actualHeight; |
| 2226 | containerPosition.left = pos.left - containerPos.left; |
| 2227 | } |
| 2228 | |
| 2229 | containerPosition.width = $element[0].offsetWidth; |
| 2230 | |
| 2231 | that.$bsContainer.css(containerPosition); |
| 2232 | }; |
| 2233 | |
| 2234 | this.$button.on('click.bs.dropdown.data-api', function () { |
| 2235 | if (that.isDisabled()) { |
no test coverage detected