diff options
| author | Johann-S <[email protected]> | 2017-04-19 10:20:50 +0200 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2017-05-14 11:41:19 +0200 |
| commit | 18e4e851e2829aedc6d1ff2b703ba5cae2c0a288 (patch) | |
| tree | aa7b385be6564bbaaeede9870ff991fc2789384e /js/src | |
| parent | d5fabf8de50710c5a09ecd91f4b9e961e67d7937 (diff) | |
| download | bootstrap-18e4e851e2829aedc6d1ff2b703ba5cae2c0a288.tar.xz bootstrap-18e4e851e2829aedc6d1ff2b703ba5cae2c0a288.zip | |
Better placement for Dropdown + Handle flip of Tooltip/Popover
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/dropdown.js | 4 | ||||
| -rw-r--r-- | js/src/tooltip.js | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index d678a3a02..613a23812 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -65,8 +65,8 @@ const Dropdown = (($) => { } const AttachmentMap = { - TOP : 'top', - BOTTOM : 'bottom' + TOP : 'top-start', + BOTTOM : 'bottom-start' } const Default = { diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 2c34ac5d7..b446d9bcc 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -287,6 +287,12 @@ const Tooltip = (($) => { offset : { offset : this.config.offset } + }, + onCreate : (data) => { + this._handlePopperPlacementChange(data) + }, + onUpdate : (data) => { + this._handlePopperPlacementChange(data) } }) @@ -637,6 +643,12 @@ const Tooltip = (($) => { } } + _handlePopperPlacementChange(data) { + if (data.originalPlacement !== data.placement) { + this._cleanTipClass() + this.addAttachmentClass(this._getAttachment(data.placement)) + } + } // static |
