mirror of
https://github.com/twbs/bootstrap.git
synced 2025-03-02 02:29:24 +01:00
Merge pull request #13593 from ResentedHook/master
Add tooltip self-reference to address #12320
This commit is contained in:
commit
bc1ce426d9
@ -46,6 +46,16 @@ $(function () {
|
|||||||
ok(!!popover.data('bs.popover'), 'popover instance exists')
|
ok(!!popover.data('bs.popover'), 'popover instance exists')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('should store popover trigger in popover instance data object', function () {
|
||||||
|
$.support.transition = false
|
||||||
|
var popover = $('<a href="#" title="ResentedHook">@ResentedHook</a>')
|
||||||
|
.appendTo('#qunit-fixture')
|
||||||
|
.bootstrapPopover()
|
||||||
|
popover.bootstrapPopover('show')
|
||||||
|
ok(!!$('.popover').data('bs.popover'), 'popover trigger stored in instance data')
|
||||||
|
$('#qunit-fixture').empty()
|
||||||
|
})
|
||||||
|
|
||||||
test('should get title and content from options', function () {
|
test('should get title and content from options', function () {
|
||||||
$.support.transition = false
|
$.support.transition = false
|
||||||
var popover = $('<a href="#">@fat</a>')
|
var popover = $('<a href="#">@fat</a>')
|
||||||
|
@ -325,6 +325,17 @@ $(function () {
|
|||||||
ok($('.tooltip').is('.fade.in'), 'tooltip should be toggled in')
|
ok($('.tooltip').is('.fade.in'), 'tooltip should be toggled in')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('should hide shown tooltip when toggle is called on tooltip', function () {
|
||||||
|
var tooltip = $('<a href="#" rel="tooltip" title="tooltip on toggle">@ResentedHook</a>')
|
||||||
|
.appendTo('#qunit-fixture')
|
||||||
|
.bootstrapTooltip({trigger: 'manual'})
|
||||||
|
.bootstrapTooltip('toggle')
|
||||||
|
$('.tooltip', '#qunit-fixture').bootstrapTooltip('toggle')
|
||||||
|
ok($('.tooltip').not('.fade.in'), 'tooltip should be toggled out')
|
||||||
|
tooltip.bootstrapTooltip('hide')
|
||||||
|
$('#qunit-fixture').empty()
|
||||||
|
})
|
||||||
|
|
||||||
test('should place tooltips inside the body', function () {
|
test('should place tooltips inside the body', function () {
|
||||||
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
||||||
.appendTo('#qunit-fixture')
|
.appendTo('#qunit-fixture')
|
||||||
|
@ -170,6 +170,7 @@
|
|||||||
.detach()
|
.detach()
|
||||||
.css({ top: 0, left: 0, display: 'block' })
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
.addClass(placement)
|
.addClass(placement)
|
||||||
|
.data('bs.' + this.type, this)
|
||||||
|
|
||||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user