Better placement for Dropdown + Handle flip of Tooltip/Popover
This commit is contained in:
parent
d5fabf8de5
commit
18e4e851e2
3 changed files with 15 additions and 3 deletions
|
|
@ -65,8 +65,8 @@ const Dropdown = (($) => {
|
|||
}
|
||||
|
||||
const AttachmentMap = {
|
||||
TOP : 'top',
|
||||
BOTTOM : 'bottom'
|
||||
TOP : 'top-start',
|
||||
BOTTOM : 'bottom-start'
|
||||
}
|
||||
|
||||
const Default = {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue