diff options
| author | Johann-S <[email protected]> | 2017-04-07 11:12:17 +0200 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2017-05-14 11:41:19 +0200 |
| commit | 81e07ec05218d75d64454787449dcb870b5b66ec (patch) | |
| tree | 88ca05ccb12b01a87b82a5ad0c3031764af47249 /js/src | |
| parent | 6cf0fe878067ba46872212da92e5288fb3331312 (diff) | |
| download | bootstrap-81e07ec05218d75d64454787449dcb870b5b66ec.tar.xz bootstrap-81e07ec05218d75d64454787449dcb870b5b66ec.zip | |
Begin to add arrow to Popover and Tooltip
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/popover.js | 1 | ||||
| -rw-r--r-- | js/src/tooltip.js | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/js/src/popover.js b/js/src/popover.js index e20b50f97..02efe2b2e 100644 --- a/js/src/popover.js +++ b/js/src/popover.js @@ -28,6 +28,7 @@ const Popover = (($) => { trigger : 'click', content : '', template : '<div class="popover" role="tooltip">' + + '<div class="arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>' }) 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() } |
