mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-13 00:54:04 +02:00
Begin to add arrow to Popover and Tooltip
This commit is contained in:
@@ -28,6 +28,7 @@ const Popover = (($) => {
|
|||||||
trigger : 'click',
|
trigger : 'click',
|
||||||
content : '',
|
content : '',
|
||||||
template : '<div class="popover" role="tooltip">'
|
template : '<div class="popover" role="tooltip">'
|
||||||
|
+ '<div class="arrow"></div>'
|
||||||
+ '<h3 class="popover-title"></h3>'
|
+ '<h3 class="popover-title"></h3>'
|
||||||
+ '<div class="popover-content"></div></div>'
|
+ '<div class="popover-content"></div></div>'
|
||||||
})
|
})
|
||||||
|
@@ -37,6 +37,7 @@ const Tooltip = (($) => {
|
|||||||
const Default = {
|
const Default = {
|
||||||
animation : true,
|
animation : true,
|
||||||
template : '<div class="tooltip" role="tooltip">'
|
template : '<div class="tooltip" role="tooltip">'
|
||||||
|
+ '<div class="arrow"></div>'
|
||||||
+ '<div class="tooltip-inner"></div></div>',
|
+ '<div class="tooltip-inner"></div></div>',
|
||||||
trigger : 'hover focus',
|
trigger : 'hover focus',
|
||||||
title : '',
|
title : '',
|
||||||
@@ -281,10 +282,8 @@ const Tooltip = (($) => {
|
|||||||
|
|
||||||
this._popper = new Popper(this.element, tip, {
|
this._popper = new Popper(this.element, tip, {
|
||||||
placement : attachment,
|
placement : attachment,
|
||||||
|
arrowElement : '.arrow',
|
||||||
modifiers : {
|
modifiers : {
|
||||||
arrow : {
|
|
||||||
element : Selector.TOOLTIP
|
|
||||||
},
|
|
||||||
offset : {
|
offset : {
|
||||||
offset : this.config.offset
|
offset : this.config.offset
|
||||||
}
|
}
|
||||||
@@ -335,7 +334,10 @@ const Tooltip = (($) => {
|
|||||||
|
|
||||||
this.element.removeAttribute('aria-describedby')
|
this.element.removeAttribute('aria-describedby')
|
||||||
$(this.element).trigger(this.constructor.Event.HIDDEN)
|
$(this.element).trigger(this.constructor.Event.HIDDEN)
|
||||||
this._popper.destroy()
|
if (this._popper !== null) {
|
||||||
|
this._popper.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
@@ -170,7 +170,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../../../docs/assets/js/vendor/jquery-slim.min.js"></script>
|
<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/util.js"></script>
|
||||||
<script src="../../dist/modal.js"></script>
|
<script src="../../dist/modal.js"></script>
|
||||||
<script src="../../dist/collapse.js"></script>
|
<script src="../../dist/collapse.js"></script>
|
||||||
|
Reference in New Issue
Block a user