diff options
| author | Gijs Boddeus <[email protected]> | 2017-09-13 16:46:14 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-09-13 16:46:14 +0200 |
| commit | cf004433e0312482a8c4918d559f38c19a3e14d9 (patch) | |
| tree | 56fd67d5a60a1fe5442c969d29918db4f463b827 /js/src/dropdown.js | |
| parent | 4356d08abb4d94785af15f3cc9be0e553f1c1c03 (diff) | |
| parent | 75d435f76e48b19007495a02e79b0d41f2690361 (diff) | |
| download | bootstrap-cf004433e0312482a8c4918d559f38c19a3e14d9.tar.xz bootstrap-cf004433e0312482a8c4918d559f38c19a3e14d9.zip | |
Merge pull request #4 from twbs/v4-dev
update forked v4-dev
Diffstat (limited to 'js/src/dropdown.js')
| -rw-r--r-- | js/src/dropdown.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index e1c48ac6e..f76f84ef0 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -1,5 +1,5 @@ -/* global Popper */ - +import $ from 'jquery' +import Popper from 'popper.js' import Util from './util' @@ -10,7 +10,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Dropdown = (($) => { +const Dropdown = (() => { /** * Check for Popper dependency @@ -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 @@ -445,6 +438,6 @@ const Dropdown = (($) => { return Dropdown -})(jQuery) +})(jQuery, Popper) export default Dropdown |
