mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Fixes #9150: Hide popover titles in IE8
Properly hides popover titles in IE8 because apparently it doesn't accept the `:empty` selector. /cc @fat @cvrebert
This commit is contained in:
parent
440d8f5318
commit
f266595092
8
dist/js/bootstrap.js
vendored
8
dist/js/bootstrap.js
vendored
@ -1503,7 +1503,13 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
|
||||
$tip.find('.popover-title:empty').hide()
|
||||
// Hide empty titles
|
||||
//
|
||||
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||
// this manually by checking the contents.
|
||||
if ($tip.find('.popover-title').html() === '') {
|
||||
$tip.find('.popover-title').hide();
|
||||
}
|
||||
}
|
||||
|
||||
Popover.prototype.hasContent = function () {
|
||||
|
2
dist/js/bootstrap.min.js
vendored
2
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@ -963,16 +963,16 @@ $('#myTooltip').on('hidden.bs.tooltip', function () {
|
||||
<h4>Four directions</h4>
|
||||
<div class="bs-example tooltip-demo">
|
||||
<div class="bs-example-tooltips">
|
||||
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
Popover on left
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
Popover on top
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
Popover on bottom
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||
Popover on right
|
||||
</button>
|
||||
</div>
|
||||
|
@ -58,7 +58,13 @@
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
|
||||
$tip.find('.popover-title:empty').hide()
|
||||
// Hide empty titles
|
||||
//
|
||||
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||
// this manually by checking the contents.
|
||||
if ($tip.find('.popover-title').html() === '') {
|
||||
$tip.find('.popover-title').hide();
|
||||
}
|
||||
}
|
||||
|
||||
Popover.prototype.hasContent = function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user