aboutsummaryrefslogtreecommitdiff
path: root/js/src/tooltip.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2017-04-07 11:12:17 +0200
committerJohann-S <[email protected]>2017-05-14 11:41:19 +0200
commit81e07ec05218d75d64454787449dcb870b5b66ec (patch)
tree88ca05ccb12b01a87b82a5ad0c3031764af47249 /js/src/tooltip.js
parent6cf0fe878067ba46872212da92e5288fb3331312 (diff)
downloadbootstrap-81e07ec05218d75d64454787449dcb870b5b66ec.tar.xz
bootstrap-81e07ec05218d75d64454787449dcb870b5b66ec.zip
Begin to add arrow to Popover and Tooltip
Diffstat (limited to 'js/src/tooltip.js')
-rw-r--r--js/src/tooltip.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index c4c4ee2f6..505a8d492 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -37,6 +37,7 @@ const Tooltip = (($) => {
const Default = {
animation : true,
template : '<div class="tooltip" role="tooltip">'
+ + '<div class="arrow"></div>'
+ '<div class="tooltip-inner"></div></div>',
trigger : 'hover focus',
title : '',
@@ -281,10 +282,8 @@ const Tooltip = (($) => {
this._popper = new Popper(this.element, tip, {
placement : attachment,
+ arrowElement : '.arrow',
modifiers : {
- arrow : {
- element : Selector.TOOLTIP
- },
offset : {
offset : this.config.offset
}
@@ -335,7 +334,10 @@ const Tooltip = (($) => {
this.element.removeAttribute('aria-describedby')
$(this.element).trigger(this.constructor.Event.HIDDEN)
- this._popper.destroy()
+ if (this._popper !== null) {
+ this._popper.destroy()
+ }
+
if (callback) {
callback()
}