1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Begin to add arrow to Popover and Tooltip

This commit is contained in:
Johann-S 2017-04-07 11:12:17 +02:00
parent 6cf0fe8780
commit 81e07ec052
3 changed files with 8 additions and 5 deletions

View file

@ -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>'
})

View file

@ -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()
}

View file

@ -170,7 +170,7 @@
</div>
<script src="../../../docs/assets/js/vendor/jquery-slim.min.js"></script>
<script src="../../../docs/assets/js/vendor/tether.min.js"></script>
<script src="../../../docs/assets/js/vendor/popper.min.js"></script>
<script src="../../dist/util.js"></script>
<script src="../../dist/modal.js"></script>
<script src="../../dist/collapse.js"></script>